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 <String.h>

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

Public Member Functions

 SmallString (StringEncoding encoding=StringEncoding::Utf8)
 
 SmallString (const SmallString &other)
 
 SmallString (SmallString &&other)
 
Stringoperator= (const SmallString &other)
 
Stringoperator= (SmallString &&other)
 
Stringoperator= (const String &other)
 
Stringoperator= (String &&other)
 
 SmallString (const String &other)
 
 SmallString (String &&other)
 
 SmallString (StringView other)
 
Stringoperator= (StringView view)
 
 SmallString (Buffer &&otherData, StringEncoding encoding)
 
template<size_t Q>
 SmallString (const char(&text)[Q])
 
template<size_t Q>
Stringoperator= (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...
 
 String (Buffer &&otherData, StringEncoding encoding)
 Builds a String from a buffer ensuring zero termination. 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...
 
Stringoperator= (StringView view)
 Assigns (copy) contents of given StringView in current String. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SC::String
native_char_tnativeWritableBytesIncludingTerminator ()
 
 String (StringEncoding encoding, SegmentHeader &header, uint32_t inlineCapacity)
 
 String (Buffer &&otherData, StringEncoding encoding, SegmentHeader &header, uint32_t inlineCapacity)
 
- Protected Attributes inherited from SC::String
StringEncoding encoding
 
Buffer 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: