MCPcopy Create free account
hub / github.com/Snapchat/Valdi / Field

Class Field

valdi_protobuf/src/valdi_protobuf/Field.hpp:20–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18using EnumValue = uint32_t;
19
20class Field {
21public:
22 enum class InternalType : uint8_t {
23 Unset,
24 Varint,
25 Fixed64,
26 Fixed32,
27 Raw,
28 Ref,
29 };
30
31 struct Raw {
32 const Byte* data;
33 size_t length;
34
35 constexpr Raw(const Byte* data, size_t length) : data(data), length(length) {}
36
37 std::string_view toStringView() const;
38 };
39
40 Field();
41 ~Field();
42
43 Field(const Field& other);
44 Field(Field&& other) noexcept;
45
46 Field& operator=(const Field& other);
47 Field& operator=(Field&& other) noexcept;
48
49 Field clone() const;
50
51 size_t byteSize(FieldNumber fieldNumber, bool writeEvenIfEmpty, bool writeEvenIfEmptyForNestedFields) const;
52
53 Byte* write(FieldNumber fieldNumber,
54 bool writeEvenIfEmpty,
55 bool writeEvenIfEmptyForNestedFields,
56 Byte* bufferStart,
57 Byte* bufferEnd) const;
58
59 int32_t getInt32() const;
60 void setInt32(int32_t v);
61
62 int32_t getSInt32() const;
63 void setSInt32(int32_t v);
64
65 int64_t getInt64() const;
66 void setInt64(int64_t v);
67
68 int64_t getSInt64() const;
69 void setSInt64(int64_t v);
70
71 uint32_t getUInt32() const;
72 void setUInt32(uint32_t v);
73
74 uint64_t getUInt64() const;
75 void setUInt64(uint64_t v);
76
77 uint64_t getFixed64() const;

Callers 6

eraseMethod · 0.70
varintMethod · 0.70
fixed64Method · 0.70
fixed32Method · 0.70
rawMethod · 0.70
refMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected