| 1 | // Copyright (C) 2022 The Qt Company Ltd. |
| 2 | // Copyright (C) 2019 Alexey Edelev <semlanik@gmail.com> |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 | |
| 5 | #include <QtProtobuf/qtprotobuftypes.h> |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | |
| 10 | /*! |
| 11 | \enum QtProtobuf::WireTypes |
| 12 | \brief The WireTypes enumeration reflects protobuf default wiretypes. |
| 13 | |
| 14 | The following table shows the values in the enumeration and their |
| 15 | corresponding types: |
| 16 | |
| 17 | \value Unknown Invalid wire type |
| 18 | \value Varint int32, int64, uint32, uint64, sint32, sint64, bool, enum |
| 19 | \value Fixed64 fixed64, sfixed64, double |
| 20 | \value LengthDelimited string, bytes, embedded messages, packed repeated fields |
| 21 | \value StartGroup groups. Deprecated in proto syntax 3. Not supported by Qt Protobuf. |
| 22 | \value EndGroup groups. Deprecated in proto syntax 3. Not supported by Qt Protobuf. |
| 23 | \value Fixed32 fixed32, sfixed32, float |
| 24 | |
| 25 | \sa {https://protobuf.dev/programming-guides/encoding} {encoding} |
| 26 | */ |
| 27 | |
| 28 | /*! |
| 29 | \class QProtobufFieldInfo |
| 30 | \inmodule QtProtobuf |
| 31 | \internal |
| 32 | \brief Holds a property's index in the property system, and the json_name. |
| 33 | |
| 34 | This class is used by the QAbstractProtobufSerializer to help serialize/ |
| 35 | deserialize protobuf messages. |
| 36 | |
| 37 | \sa QProtobufPropertyOrdering |
| 38 | */ |
| 39 | |
| 40 | /*! |
| 41 | \typealias QProtobufPropertyOrdering |
| 42 | \internal |
| 43 | |
| 44 | A map between the property field index and an instance of |
| 45 | QProtobufFieldInfo. |
| 46 | |
| 47 | \sa Q_PROTOBUF_OBJECT |
| 48 | */ |
| 49 | |
| 50 | /*! |
| 51 | \namespace QtProtobuf |
| 52 | \brief The QtProtobuf namespace contains type aliases and classes needed to support Qt Protobuf. |
| 53 | \inmodule QtProtobuf |
| 54 | */ |
| 55 | |
| 56 | /*! |
| 57 | \struct QtProtobuf::transparent |
| 58 | \inmodule QtProtobuf |
| 59 | \internal |
| 60 | \brief Only used to create new, unique types for numeric types. |
| 61 | */ |
| 62 | |
| 63 | /*! |
| 64 | \typealias QtProtobuf::int32 |
| 65 | |
| 66 | int32 is a regular signed 32-bit integer that is represented in protobuf as |
| 67 | a variable size integer, an alias for WireTypes::Varint. |
| 68 | */ |
| 69 | |
| 70 | /*! |
| 71 | \typealias QtProtobuf::int64 |
| 72 | |
| 73 | int64 is a regular signed 64-bit integer that is represented in protobuf as |
| 74 | a variable size integer, an alias for WireTypes::Varint. |
| 75 | */ |
| 76 | |
| 77 | /*! |
| 78 | \typealias QtProtobuf::uint32 |
| 79 | |
| 80 | uint32 is an unsigned 32-bit integer that is represented in protobuf as |
| 81 | variable size integer, an alias for WireTypes::Varint. |
| 82 | */ |
| 83 | |
| 84 | /*! |
| 85 | \typealias QtProtobuf::uint64 |
| 86 | |
| 87 | uint64 is an unsigned 64-bit integer that is represented in protobuf as |
| 88 | variable size integer, an alias for WireTypes::Varint. |
| 89 | */ |
| 90 | |
| 91 | /*! |
| 92 | \typealias QtProtobuf::sint32 |
| 93 | |
| 94 | sint32 is a 32-bit integer with forced sign marker that is represented in |
| 95 | protobuf as variable size integer, an alias for WireTypes::Varint. |
| 96 | sint32 is serialized using ZigZag conversion to reduce size of negative |
| 97 | numbers. |
| 98 | |
| 99 | \sa {https://protobuf.dev/programming-guides/encoding/#signed-ints} {signed-integers} |
| 100 | */ |
| 101 | |
| 102 | /*! |
| 103 | \typealias QtProtobuf::sint64 |
| 104 | |
| 105 | sint64 is a 64-bit integer with forced sign marker that is represented in |
| 106 | protobuf as variable size integer, an alias for WireTypes::Varint. |
| 107 | sint64 is serialized using ZigZag conversion to reduce size of negative numbers. |
| 108 | |
| 109 | \sa {https://protobuf.dev/programming-guides/encoding/#signed-ints} {signed-integers} |
| 110 | */ |
| 111 | |
| 112 | /*! |
| 113 | \typealias QtProtobuf::fixed32 |
| 114 | |
| 115 | fixed32 is an unsigned 32-bit integer that is represented in protobuf as a |
| 116 | fixed size 32-bit field, an alias for WireTypes::Fixed32. |
| 117 | */ |
| 118 | |
| 119 | /*! |
| 120 | \typealias QtProtobuf::fixed64 |
| 121 | |
| 122 | fixed64 is an unsigned 64-bit integer that is represented in protobuf as a |
| 123 | fixed size 64-bit field, an alias for WireTypes::Fixed64. |
| 124 | */ |
| 125 | |
| 126 | /*! |
| 127 | \typealias QtProtobuf::sfixed32 |
| 128 | |
| 129 | sfixed32 is a signed 32-bit integer that is represented in protobuf as a |
| 130 | fixed size 32-bit field, an alias for WireTypes::Fixed32. |
| 131 | */ |
| 132 | |
| 133 | /*! |
| 134 | \typealias QtProtobuf::sfixed64 |
| 135 | |
| 136 | sfixed64 is a signed 64-bit integer that is represented in protobuf as a |
| 137 | fixed size 64-bit field, an alias for WireTypes::Fixed64. |
| 138 | */ |
| 139 | |
| 140 | /*! |
| 141 | \typealias QtProtobuf::int32List |
| 142 | |
| 143 | Alias for a list of QtProtobuf::int32. |
| 144 | */ |
| 145 | |
| 146 | /*! |
| 147 | \typealias QtProtobuf::int64List |
| 148 | |
| 149 | Alias for a list of QtProtobuf::int64. |
| 150 | */ |
| 151 | |
| 152 | /*! |
| 153 | \typealias QtProtobuf::uint32List |
| 154 | |
| 155 | Alias for a list of QtProtobuf::uint32. |
| 156 | */ |
| 157 | |
| 158 | /*! |
| 159 | \typealias QtProtobuf::uint64List |
| 160 | |
| 161 | Alias for a list of QtProtobuf::uint64. |
| 162 | */ |
| 163 | |
| 164 | /*! |
| 165 | \typealias QtProtobuf::sint32List |
| 166 | |
| 167 | Alias for a list of QtProtobuf::sint32. |
| 168 | */ |
| 169 | |
| 170 | /*! |
| 171 | \typealias QtProtobuf::sint64List |
| 172 | |
| 173 | Alias for a list of QtProtobuf::sint64. |
| 174 | */ |
| 175 | |
| 176 | /*! |
| 177 | \typealias QtProtobuf::fixed32List |
| 178 | |
| 179 | Alias for a list of QtProtobuf::fixed32. |
| 180 | */ |
| 181 | |
| 182 | /*! |
| 183 | \typealias QtProtobuf::fixed64List |
| 184 | |
| 185 | Alias for a list of QtProtobuf::fixed64. |
| 186 | */ |
| 187 | |
| 188 | /*! |
| 189 | \typealias QtProtobuf::sfixed32List |
| 190 | |
| 191 | Alias for a list of QtProtobuf::sfixed32. |
| 192 | */ |
| 193 | |
| 194 | /*! |
| 195 | \typealias QtProtobuf::sfixed64List |
| 196 | |
| 197 | Alias for a list of QtProtobuf::sfixed64. |
| 198 | */ |
| 199 | |
| 200 | /*! |
| 201 | \typealias QtProtobuf::floatList |
| 202 | |
| 203 | Alias for a list of float. |
| 204 | */ |
| 205 | |
| 206 | /*! |
| 207 | \typealias QtProtobuf::doubleList |
| 208 | |
| 209 | Alias for a list of double. |
| 210 | */ |
| 211 | |
| 212 | /*! |
| 213 | \typealias QtProtobuf::boolList |
| 214 | |
| 215 | Alias for a list of bool. |
| 216 | */ |
| 217 | |
| 218 | /*! |
| 219 | \typealias QtProtobuf::RegisterFunction |
| 220 | \internal |
| 221 | */ |
| 222 | |
| 223 | /*! |
| 224 | \fn template <typename T> struct QtProtobuf::ProtoTypeRegistrar |
| 225 | \internal |
| 226 | |
| 227 | Used in the type registration process. |
| 228 | */ |
| 229 | |
| 230 | QT_END_NAMESPACE |
| 231 | |
| 232 | #include "moc_qtprotobuftypes.cpp" |
| 233 | |