Use `std::is_base_of_v` instead of `std::derived_from`
[google-protobuf.git] / objectivec / GPBWireFormat.h
blob557e023f47cba727350549b4c1587fc21f15e50b
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
8 #import "GPBRuntimeTypes.h"
10 CF_EXTERN_C_BEGIN
12 NS_ASSUME_NONNULL_BEGIN
14 typedef enum {
15 GPBWireFormatVarint = 0,
16 GPBWireFormatFixed64 = 1,
17 GPBWireFormatLengthDelimited = 2,
18 GPBWireFormatStartGroup = 3,
19 GPBWireFormatEndGroup = 4,
20 GPBWireFormatFixed32 = 5,
21 } GPBWireFormat;
23 enum {
24 GPBWireFormatMessageSetItem = 1,
25 GPBWireFormatMessageSetTypeId = 2,
26 GPBWireFormatMessageSetMessage = 3
29 uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) __attribute__((const));
30 GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const));
31 uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const));
32 BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const));
34 GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) __attribute__((const));
36 #define GPBWireFormatMessageSetItemTag \
37 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup))
38 #define GPBWireFormatMessageSetItemEndTag \
39 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup))
40 #define GPBWireFormatMessageSetTypeIdTag \
41 (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint))
42 #define GPBWireFormatMessageSetMessageTag \
43 (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, GPBWireFormatLengthDelimited))
45 NS_ASSUME_NONNULL_END
47 CF_EXTERN_C_END