StaticString.hpp
String substitute with a fixed max character count and always in place.
A fixed number of chars are reserved for the string; errors will trigger for longer attempts. The last allocated byte stores the number of unused positions in the string; this naturally becomes zero (the final character in a string) when all positions are used.
Note
Status: ALPHA
Typedefs
-
using ShortString = StaticString<31>
-
template<size_t NUM_CHARS, typename CHAR_T = char>
class StaticString - #include <StaticString.hpp>
Public Functions
-
inline StaticString()
-
StaticString(const StaticString&) = default
-
StaticString &operator=(const StaticString&) = default
-
inline StaticString &operator=(const std::string &in)
-
inline StaticString &operator=(CHAR_T const *in)
-
template<size_t SIZE>
inline StaticString &operator=(CHAR_T in[SIZE])
-
inline size_t size() const
-
inline void resize(size_t new_size)
-
inline StaticString &push_back(CHAR_T c)
-
inline StaticString &append(const CHAR_T *in_str, size_t len)
-
inline StaticString &append(const std::string &in_str)
-
template<size_t SIZE>
inline StaticString &append(CHAR_T in_str[SIZE])
-
template<size_t NUM_CHARS2>
inline StaticString &append(StaticString<NUM_CHARS2, CHAR_T> in_str)
Private Functions
-
inline StaticString &CopyFrom(const CHAR_T *in, size_t len)
-
inline StaticString()