class TaggedStringPtr
Defined at line 75 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
Public Methods
void TaggedStringPtr ()
Defined at line 109 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
void TaggedStringPtr (ExplicitlyConstructedArenaString * ptr)
Defined at line 110 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
const std::string * SetDefault (const std::string * p)
Sets the value to `p`, tagging the value as being a 'default' value.
See documentation for kDefault for more info.
Defined at line 115 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
std::string * SetAllocated (std::string * p)
Sets the value to `p`, tagging the value as a heap allocated value.
Allocated strings are mutable and (as the name implies) owned.
`p` must not be null
Defined at line 122 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
std::string * SetFixedSizeArena (std::string * p)
Sets the value to `p`, tagging the value as a fixed size arena string.
See documentation for kFixedSizeArena for more info.
`p` must not be null
Defined at line 129 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
std::string * SetMutableArena (std::string * p)
Sets the value to `p`, tagging the value as a mutable arena string.
See documentation for kMutableArena for more info.
`p` must not be null
Defined at line 136 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
bool IsMutable ()
Returns true if the contents of the current string are fully mutable.
Defined at line 141 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
bool IsDefault ()
Returns true if the current string is an immutable default value.
Defined at line 144 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
std::string * GetIfAllocated ()
If the current string is a heap-allocated mutable value, returns a pointer
to it. Returns nullptr otherwise.
Defined at line 148 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
bool IsArena ()
Returns true if the current string is an arena allocated value.
This means it's either a mutable or fixed size arena string.
Defined at line 159 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
bool IsFixedSizeArena ()
Returns true if the current string is a fixed size arena allocated value.
Defined at line 162 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
std::string * Get ()
Returns the contained string pointer.
Defined at line 167 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
bool IsNull ()
Returns true if the contained pointer is null, indicating some error.
The Null value is only used during parsing for temporary values.
A persisted ArenaStringPtr value is never null.
Defined at line 174 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
TaggedStringPtr Copy (Arena * arena)
Returns a copy of this instance. In debug builds, the returned value may be
a forced copy regardless if the current instance is a compile time default.
Defined at line 430 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
TaggedStringPtr Copy (Arena * arena, const LazyString & default_value)
Identical to the above `Copy` function except that in debug builds,
`default_value` can be used to substitute an empty default with a
hardened copy of the default value.
Defined at line 438 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
Enumerations
enum Flags
| Name | Value |
|---|---|
| kArenaBit | 0x1 |
| kMutableBit | 0x2 |
| kMask | 0x3 |
Bit flags qualifying string properties. We can use 2 bits as
ptr_ is guaranteed and enforced to be aligned on 4 byte boundaries.
Defined at line 79 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h
enum Type
| Name | Value |
|---|---|
| kDefault | 0 |
| kAllocated | kMutableBit |
| kMutableArena | kArenaBit | kMutableBit |
| kFixedSizeArena | kArenaBit |
Composed logical types
Defined at line 86 of file ../../third_party/protobuf/src/google/protobuf/arenastring.h