Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::SmallString< N > Struct Template Reference

String with compile time configurable inline storage (small string optimization) More...

#include <SmallString.h>

Inheritance diagram for SC::SmallString< N >:
SC::String

Public Member Functions

 SmallString (StringEncoding encoding=StringEncoding::Utf8)
 
 SmallString (StringView view)
 
template<size_t Q>
 SmallString (const char(&text)[Q])
 
 SmallString (Vector< char > &&data, StringEncoding encoding)
 
 SmallString (SmallString &&other)
 
 SmallString (const SmallString &other)
 
SmallStringoperator= (SmallString &&other) noexcept
 
SmallStringoperator= (const SmallString &other)
 
SmallStringoperator= (StringView other)
 
 SmallString (String &&other)
 
 SmallString (const String &other)
 
SmallStringoperator= (String &&other)
 
SmallStringoperator= (const String &other)
 
template<size_t Q>
SmallStringoperator= (const char(&text)[Q])
 
- Public Member Functions inherited from SC::String
 String (StringEncoding encoding=StringEncoding::Utf8)
 Builds an empty String with a given Encoding. More...
 
 String (StringView sv)
 Builds String from a StringView. More...
 
template<size_t N>
 String (const char(&text)[N])
 Builds String with a null terminated char string literal. More...
 
bool owns (StringView view) const
 Checks if the memory pointed by the StringView is owned by this String. More...
 
bool assign (StringView sv)
 Assigns a StringView to this String, replacing existing contents. More...
 
StringEncoding getEncoding () const
 Get StringView encoding. More...
 
size_t sizeInBytesIncludingTerminator () const
 Get length of the string in bytes (including null terminator bytes) More...
 
const char * bytesIncludingTerminator () const
 Access current string content as read-only null-terminated const char* More...
 
bool isEmpty () const
 Check if String is empty. More...
 
StringView view () const SC_LANGUAGE_LIFETIME_BOUND
 Obtain a null-terminated StringView from current String. More...
 
bool operator== (const String &other) const
 Check if current String is same as other String. More...
 
bool operator!= (const String &other) const
 Check if current String is different from other String. More...
 
bool operator== (const StringView other) const
 Check if current String is same as other StringView. More...
 
bool operator!= (const StringView other) const
 Check if current String is different from other StringView. More...
 
bool operator< (const StringView other) const
 Check if current String is smaller to another StringView (using StringView::compare) More...
 
template<size_t N>
bool operator== (const char(&other)[N]) const
 Check if current String is equal to the ascii string literal. More...
 
template<size_t N>
bool operator!= (const char(&other)[N]) const
 Check if current String is different from the ascii string literal. More...
 
template<size_t N>
Stringoperator= (const char(&text)[N])
 Assigns an ascii string literal to current String. More...
 

Public Attributes

Array< char, N > buffer
 

Additional Inherited Members

- Protected Member Functions inherited from SC::String
auto nativeWritableBytesIncludingTerminator ()
 
- Protected Attributes inherited from SC::String
StringEncoding encoding
 
Vector< char > data
 

Detailed Description

template<int N>
struct SC::SmallString< N >

String with compile time configurable inline storage (small string optimization)

Template Parameters
Nnumber of chars to reserve in inline storage

The documentation for this struct was generated from the following file: