Sane C++ Libraries
C++ Platform Abstraction Libraries
Strings

🟩 String formatting / conversion / manipulation (ASCII / UTF8 / UTF16) (see Strings for more details) More...

Classes

struct  SC::Console
 Writes to console using SC::StringFormat. More...
 
struct  SC::SmallString< N >
 String with compile time configurable inline storage (small string optimization) More...
 
struct  SC::String
 A non-modifiable owning string with associated encoding. More...
 
struct  SC::StringBuilder
 Builds String out of a sequence of StringView or formatting through StringFormat. More...
 
struct  SC::StringConverter
 Converts String to a different encoding (UTF8, UTF16). More...
 
struct  SC::StringFormatOutput
 Allows pushing results of StringFormat to a buffer or to the console. More...
 
struct  SC::StringFormat< RangeIterator >
 Formats String with a simple DSL embedded in the format string. More...
 
struct  SC::StringIterator< CharIterator >
 A position inside a fixed range [start, end) of UTF code points. More...
 
struct  SC::StringIteratorASCII
 A string iterator for ASCII strings. More...
 
struct  SC::StringIteratorUTF16
 A string iterator for UTF16 strings. More...
 
struct  SC::StringIteratorUTF8
 A string iterator for UTF8 strings. More...
 
struct  SC::StringIteratorSkipTable
 Builds a constexpr bool skip table of 256 entries used in some parsers. More...
 
struct  SC::StringView
 Non-owning view over a range of characters with UTF Encoding. More...
 
struct  SC::StringViewTokenizer
 Splits a StringView in tokens according to separators. More...
 
struct  SC::StringAlgorithms
 Algorithms operating on strings (glob / wildcard). More...
 

Typedefs

using SC::StringCodePoint = uint32_t
 UTF code point (32 bit) More...
 

Enumerations

enum class  SC::StringEncoding : uint8_t {
  StringEncoding::Ascii = 0 ,
  StringEncoding::Utf8 = 1 ,
  StringEncoding::Utf16 = 2 ,
  StringEncoding::Native = Utf8
}
 String Encoding (Ascii, Utf8, Utf16) More...
 

Functions

template<unsigned int N>
constexpr unsigned int SC::StringHashFNV (const char(&str)[N])
 Compute compile time FNV hash for a char array. More...
 
constexpr bool SC::StringEncodingAreBinaryCompatible (StringEncoding encoding1, StringEncoding encoding2)
 Checks if two encodings have the same utf unit size. More...
 
constexpr uint32_t SC::StringEncodingGetSize (StringEncoding encoding)
 Returns the number of bytes to represent an utf unit in the given encoding. More...
 

Detailed Description

🟩 String formatting / conversion / manipulation (ASCII / UTF8 / UTF16) (see Strings for more details)

Typedef Documentation

◆ StringCodePoint

using SC::StringCodePoint = typedef uint32_t

#include <StringIterator.h>

UTF code point (32 bit)

Enumeration Type Documentation

◆ StringEncoding

enum class SC::StringEncoding : uint8_t
strong

#include <StringIterator.h>

String Encoding (Ascii, Utf8, Utf16)

Enumerator
Ascii 

Encoding is ASCII.

Utf8 

Encoding is UTF8.

Utf16 

Encoding is UTF16-LE.

Native 

Encoding is UTF8.

Function Documentation

◆ StringEncodingAreBinaryCompatible()

constexpr bool SC::StringEncodingAreBinaryCompatible ( StringEncoding  encoding1,
StringEncoding  encoding2 
)
constexpr

#include <StringIterator.h>

Checks if two encodings have the same utf unit size.

Parameters
encoding1First encoding
encoding2Second encoding
Returns
true if the two encodings have the same unit size

◆ StringEncodingGetSize()

constexpr uint32_t SC::StringEncodingGetSize ( StringEncoding  encoding)
constexpr

#include <StringIterator.h>

Returns the number of bytes to represent an utf unit in the given encoding.

Parameters
encodingThe encoding
Returns
number of bytes of the given encoding

◆ StringHashFNV()

template<unsigned int N>
constexpr unsigned int SC::StringHashFNV ( const char(&)  str[N])
constexpr

#include <StringHashFNV.h>

Compute compile time FNV hash for a char array.