30 static_cast<FwAssertArgType>(this->
maxLength()));
36 return capacity == 0 ? 0 : capacity - 1;
49 if (len != other.
length()) {
58 if ((us ==
nullptr) or (other ==
nullptr)) {
63 const size_t result =
static_cast<size_t>(strncmp(us, other, static_cast<size_t>(capacity)));
92 std::ostream& operator<<(std::ostream& os,
const ConstStringBase& str) {
98 #if FW_SERIALIZABLE_TO_STRING || BUILD_UT 99 void ConstStringBase::toString(StringBase& text)
const {
PlatformSizeType FwSizeType
bool operator!=(const ConstStringBase &other) const
Inequality with ConstStringBase.
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
virtual SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG)=0
Serialize an 8-bit unsigned integer value.
SerializeStatus
forward declaration for string
SizeType serializedSize() const
U16 FwSizeStoreType
The type used to serialize a size value.
bool operator==(const ConstStringBase &other) const
Check for equality with ConstStringBase.
SizeType serializedTruncatedSize(FwSizeType maxLength) const
#define FW_MIN(a, b)
MIN macro.
virtual SizeType getCapacity() const =0
Return the size of the buffer.
SizeType maxLength() const
Get the maximum length of a string that the buffer can hold (which is capacity - 1) ...
A read-only abstract superclass for StringBase.
Include length as first token in serialization.
virtual SizeType length() const
Get the length of the string.
virtual ~ConstStringBase()
Implementation of malloc based allocator.
Attempted to deserialize into an immutable buffer.
SerializeStatus deserializeFrom(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) override
Deserialize the contents of this object from a buffer.
FwSizeType string_length(const CHAR *source, FwSizeType buffer_size)
get the length of the source string
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.