MutableString

A string reference to a fixed-length array for its data.

All Strings operate in a manner compatible with std::string wherever feasable in the functions implemented.  MutableString have a maximum size, but the data they contain is on loan from whatever constructed them.

All mutating algorithms on strings supported by the String suite should be implemented on MutableStrings.  Strings use the MutableString implementations, with a possible resize to prevent clipping.

MutableStrings require both a buffer, and a reference to the length of the string.  They are not meant to be constructed directly by client code.  Instead, use them by cast-constructing them from ArrayStrings or Strings.

Even more than ConstStrings, MutableStrings are not designed to be storable.

See Also

Summary
MutableStringA string reference to a fixed-length array for its data.
Functions
MutableStringConstructs a mutable string.
dataa chararcter pointer to the data.
c_stra chararcter pointer to NUL terminated data.
lengththe current length of the string.
sizethe current length of the string.
capacitythe current capacity of the string.
formatprints into the string, like printf.
vformatprints into the string, like vprintf.
beginthe const_iterator at the begining of the string.
endthe const_iterator at the end of the string.
beginthe iterator at the end of the string.
endthe iterator at the end of the string.

Functions

MutableString

MutableString(char *buffer,
size_type buffersize,
size_type &length)

Constructs a mutable string.

Parameters

bufferThe data for the string
buffersizeThe size of the buffer, (including the NUL terminator)
lengthA reference to the length of the string.

data

const char *data() const

Returns

a chararcter pointer to the data.

c_str

const char *c_str() const

Returns

a chararcter pointer to NUL terminated data.

length

size_type length() const

the current length of the string.

size

size_type size() const

the current length of the string.

capacity

size_type capacity() const

the current capacity of the string.

format

size_type format(const char *format,
 ...)

prints into the string, like printf.

Returns

the number of characters formatted ignoring truncation.

vformat

size_type vformat(const char *format,
 std::va_list)

prints into the string, like vprintf.

Returns

the number of characters formatted ignoring truncation.

begin

const_iterator begin() const

the const_iterator at the begining of the string.

end

const_iterator end() const

the const_iterator at the end of the string.

begin

iterator begin()

the iterator at the end of the string.

end

iterator end()

the iterator at the end of the string.

MutableString(char *buffer,
size_type buffersize,
size_type &length)
Constructs a mutable string.
const char *data() const
a chararcter pointer to the data.
const char *c_str() const
a chararcter pointer to NUL terminated data.
size_type length() const
the current length of the string.
size_type size() const
the current length of the string.
size_type capacity() const
the current capacity of the string.
size_type format(const char *format,
 ...)
prints into the string, like printf.
size_type vformat(const char *format,
 std::va_list)
prints into the string, like vprintf.
const_iterator begin() const
the const_iterator at the begining of the string.
const_iterator end() const
the const_iterator at the end of the string.
class ReflectExport(reflect) ConstString
A ConstString is a reflected string type which doesn’t own its data.
class ReflectExport(reflect) Fragment
A Fragment is the most basic string type in the reflect string suite.
Close