![]() |
|
|||
File indexing completed on 2025-02-27 10:05:04
0001 // Protocol Buffers - Google's data interchange format 0002 // Copyright 2008 Google Inc. All rights reserved. 0003 // 0004 // Use of this source code is governed by a BSD-style 0005 // license that can be found in the LICENSE file or at 0006 // https://developers.google.com/open-source/licenses/bsd 0007 // 0008 // This file contains definitions for the descriptors, so they can be used 0009 // without importing descriptor.h 0010 0011 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__ 0012 #define GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__ 0013 0014 namespace google { 0015 namespace protobuf { 0016 namespace internal { 0017 0018 class FieldDescriptorLite { 0019 public: 0020 // Identifies a field type. 0 is reserved for errors. 0021 // The order is weird for historical reasons. 0022 // Types 12 and up are new in proto2. 0023 enum Type { 0024 TYPE_DOUBLE = 1, // double, exactly eight bytes on the wire. 0025 TYPE_FLOAT = 2, // float, exactly four bytes on the wire. 0026 TYPE_INT64 = 3, // int64, varint on the wire. Negative numbers 0027 // take 10 bytes. Use TYPE_SINT64 if negative 0028 // values are likely. 0029 TYPE_UINT64 = 4, // uint64, varint on the wire. 0030 TYPE_INT32 = 5, // int32, varint on the wire. Negative numbers 0031 // take 10 bytes. Use TYPE_SINT32 if negative 0032 // values are likely. 0033 TYPE_FIXED64 = 6, // uint64, exactly eight bytes on the wire. 0034 TYPE_FIXED32 = 7, // uint32, exactly four bytes on the wire. 0035 TYPE_BOOL = 8, // bool, varint on the wire. 0036 TYPE_STRING = 9, // UTF-8 text. 0037 TYPE_GROUP = 10, // Tag-delimited message. Deprecated. 0038 TYPE_MESSAGE = 11, // Length-delimited message. 0039 0040 TYPE_BYTES = 12, // Arbitrary byte array. 0041 TYPE_UINT32 = 13, // uint32, varint on the wire 0042 TYPE_ENUM = 14, // Enum, varint on the wire 0043 TYPE_SFIXED32 = 15, // int32, exactly four bytes on the wire 0044 TYPE_SFIXED64 = 16, // int64, exactly eight bytes on the wire 0045 TYPE_SINT32 = 17, // int32, ZigZag-encoded varint on the wire 0046 TYPE_SINT64 = 18, // int64, ZigZag-encoded varint on the wire 0047 0048 MAX_TYPE = 18, // Constant useful for defining lookup tables 0049 // indexed by Type. 0050 }; 0051 0052 // Specifies the C++ data type used to represent the field. There is a 0053 // fixed mapping from Type to CppType where each Type maps to exactly one 0054 // CppType. 0 is reserved for errors. 0055 enum CppType { 0056 CPPTYPE_INT32 = 1, // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32 0057 CPPTYPE_INT64 = 2, // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64 0058 CPPTYPE_UINT32 = 3, // TYPE_UINT32, TYPE_FIXED32 0059 CPPTYPE_UINT64 = 4, // TYPE_UINT64, TYPE_FIXED64 0060 CPPTYPE_DOUBLE = 5, // TYPE_DOUBLE 0061 CPPTYPE_FLOAT = 6, // TYPE_FLOAT 0062 CPPTYPE_BOOL = 7, // TYPE_BOOL 0063 CPPTYPE_ENUM = 8, // TYPE_ENUM 0064 CPPTYPE_STRING = 9, // TYPE_STRING, TYPE_BYTES 0065 CPPTYPE_MESSAGE = 10, // TYPE_MESSAGE, TYPE_GROUP 0066 0067 MAX_CPPTYPE = 10, // Constant useful for defining lookup tables 0068 // indexed by CppType. 0069 }; 0070 0071 // Identifies whether the field is optional, required, or repeated. 0 is 0072 // reserved for errors. 0073 enum Label { 0074 LABEL_OPTIONAL = 1, // optional 0075 LABEL_REQUIRED = 2, // required 0076 LABEL_REPEATED = 3, // repeated 0077 0078 MAX_LABEL = 3, // Constant useful for defining lookup tables 0079 // indexed by Label. 0080 }; 0081 0082 // Identifies the storage type of a C++ string field. This corresponds to 0083 // pb.CppFeatures.StringType, but is compatible with ctype prior to Edition 0084 // 2024. 0 is reserved for errors. 0085 #ifndef SWIG 0086 enum class CppStringType { 0087 kView = 1, 0088 kCord = 2, 0089 kString = 3, 0090 }; 0091 #endif 0092 }; 0093 0094 } // namespace internal 0095 } // namespace protobuf 0096 } // namespace google 0097 0098 #endif // GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |