docs
Loading...
Searching...
No Matches
String32

#include <Ultralight/String32.h>

Overview

A null-terminated UTF-32 string container.

Public Types

typedef char32_t CharType
 Native character type.

Public Member Functions

 String32 ()
 Make an empty String32.
 String32 (const char32_t *c_str, size_t len)
 Make a String32 from raw UTF-32 string with certain length.
 String32 (const String32 &other)
 Make a deep copy of String32.
 String32 (String32 &&other)
 Move constructor.
 ~String32 ()
 Destructor.
String32 & operator= (const String32 &other)
 Assign a String32 to this one, deep copy is made.
String32 & operator= (String32 &&other)
 Move assignment operator.
String32 & operator+= (const String32 &other)
 Append a String32 to this one.
char32_t * data ()
 Get raw UTF-32 data.
const char32_t * data () const
 Get raw UTF-32 data (const).
size_t length () const
 Get length in characters.
size_t size () const
 Get size in characters (synonym for length).
size_t sizeBytes () const
 Get size in bytes.
bool empty () const
 Check if string is empty.
char32_t & operator[] (size_t pos)
 Get character at specific position.
const char32_t & operator[] (size_t pos) const
 Get character at specific position (const).
String8 utf8 () const
 Get a UTF-8 copy of this string.
String16 utf16 () const
 Get a UTF-16 copy of this string.
size_t Hash () const
 Hash function.
bool operator< (const String32 &other) const
 Comparison operator.
bool operator== (const String32 &other) const
 Equality operator.
bool operator!= (const String32 &other) const
 Inequality operator.

Friends

String32 operator+ (String32 lhs, const String32 &rhs)
 Concatenation operator.

Member Typedef Documentation

◆ CharType

typedef char32_t CharType

Native character type.

Constructor & Destructor Documentation

◆ String32() [1/4]

String32 ( )

Make an empty String32.

◆ String32() [2/4]

String32 ( const char32_t * c_str,
size_t len )

Make a String32 from raw UTF-32 string with certain length.

◆ String32() [3/4]

String32 ( const String32 & other)

Make a deep copy of String32.

◆ String32() [4/4]

String32 ( String32 && other)

Move constructor.

◆ ~String32()

~String32 ( )

Destructor.

Member Function Documentation

◆ data() [1/2]

char32_t * data ( )
inline

Get raw UTF-32 data.

◆ data() [2/2]

const char32_t * data ( ) const
inline

Get raw UTF-32 data (const).

◆ empty()

bool empty ( ) const
inline

Check if string is empty.

◆ Hash()

size_t Hash ( ) const

Hash function.

◆ length()

size_t length ( ) const
inline

Get length in characters.

◆ operator!=()

bool operator!= ( const String32 & other) const

Inequality operator.

◆ operator+=()

String32 & operator+= ( const String32 & other)

Append a String32 to this one.

◆ operator<()

bool operator< ( const String32 & other) const

Comparison operator.

◆ operator=() [1/2]

String32 & operator= ( const String32 & other)

Assign a String32 to this one, deep copy is made.

◆ operator=() [2/2]

String32 & operator= ( String32 && other)

Move assignment operator.

◆ operator==()

bool operator== ( const String32 & other) const

Equality operator.

◆ operator[]() [1/2]

char32_t & operator[] ( size_t pos)
inline

Get character at specific position.

◆ operator[]() [2/2]

const char32_t & operator[] ( size_t pos) const
inline

Get character at specific position (const).

◆ size()

size_t size ( ) const
inline

Get size in characters (synonym for length).

◆ sizeBytes()

size_t sizeBytes ( ) const
inline

Get size in bytes.

◆ utf16()

String16 utf16 ( ) const

Get a UTF-16 copy of this string.

◆ utf8()

String8 utf8 ( ) const

Get a UTF-8 copy of this string.

◆ operator+

String32 operator+ ( String32 lhs,
const String32 & rhs )
friend

Concatenation operator.


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