diff options
Diffstat (limited to 'objectivec/GPBWireFormat.m')
-rw-r--r-- | objectivec/GPBWireFormat.m | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/objectivec/GPBWireFormat.m b/objectivec/GPBWireFormat.m index 193235d6..860a339f 100644 --- a/objectivec/GPBWireFormat.m +++ b/objectivec/GPBWireFormat.m @@ -49,6 +49,13 @@ uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) { return GPBLogicalRightShift32(tag, GPBWireFormatTagTypeBits); } +BOOL GPBWireFormatIsValidTag(uint32_t tag) { + uint32_t formatBits = (tag & GPBWireFormatTagTypeMask); + // The valid GPBWireFormat* values are 0-5, anything else is not a valid tag. + BOOL result = (formatBits <= 5); + return result; +} + GPBWireFormat GPBWireFormatForType(GPBDataType type, BOOL isPacked) { if (isPacked) { return GPBWireFormatLengthDelimited; |