MyScript Interactive Ink SDK 4.3.0
Public Member Functions | List of all members
myscript::iink::String Class Reference

#include <String.h>

Public Member Functions

 String ()
 
 String (const String &str)
 
 String (String &&str)
 
 String (const std::string &str)
 
 String (std::string &&str)
 
 String (const char *str)
 
 String (const std::u16string &str)
 
 String (std::u16string &&str)
 
 String (const char16_t *str)
 
virtual ~String ()
 
String & operator= (const String &other)
 
String & operator= (String &&other)
 
bool isUtf8 () const
 
bool isUtf16 () const
 
bool isEmpty () const
 
size_t size () const
 
const char * c_str () const
 
String toUtf8 () const
 
String toUtf16 () const
 
const std::string & asUtf8 () const
 
 operator std::string () const
 
 operator std::u16string () const
 
int compare (const char *other) const
 
int compare (const std::string &other) const
 
int compare (const char16_t *other) const
 
int compare (const std::u16string &other) const
 
int compare (const String &other) const
 
bool operator== (const String &other) const
 
bool operator!= (const String &other) const
 
bool operator< (const String &other) const
 
bool operator<= (const String &other) const
 
bool operator> (const String &other) const
 
bool operator>= (const String &other) const
 

Detailed Description

Represents a sequence of characters with automatic conversion between UTF-8 and UTF-16.

Constructor & Destructor Documentation

◆ String() [1/9]

myscript::iink::String::String ( )

Constructs an empty string.

◆ String() [2/9]

myscript::iink::String::String ( const String &  str)

Constructs a copy of the specified string.

Parameters
strthe string to copy.

◆ String() [3/9]

myscript::iink::String::String ( String &&  str)

Constructs a copy by moving the specified string.

Parameters
strthe string to move.

◆ String() [4/9]

myscript::iink::String::String ( const std::string &  str)

Constructs a string from its UTF-8 representation.

Parameters
strthe UTF-8 representation to copy.

◆ String() [5/9]

myscript::iink::String::String ( std::string &&  str)

Constructs a string from its UTF-8 representation.

Parameters
strthe UTF-8 representation to move.

◆ String() [6/9]

myscript::iink::String::String ( const char *  str)

Constructs a string from its UTF-8 representation.

Parameters
strthe UTF-8 representation.

◆ String() [7/9]

myscript::iink::String::String ( const std::u16string &  str)

Constructs a string from its UTF-16 representation.

Parameters
strthe UTF-16 representation to copy.

◆ String() [8/9]

myscript::iink::String::String ( std::u16string &&  str)

Constructs a string from its UTF-16 representation.

Parameters
strthe UTF-16 representation to move.

◆ String() [9/9]

myscript::iink::String::String ( const char16_t *  str)

Constructs a string from its UTF-16 representation.

Parameters
strthe UTF-16 representation.

◆ ~String()

virtual myscript::iink::String::~String ( )
virtual

Member Function Documentation

◆ operator=() [1/2]

String & myscript::iink::String::operator= ( const String &  other)

Copy assigns the other string to this string.

Parameters
otherthe string to copy.
Returns
a reference to this string.

◆ operator=() [2/2]

String & myscript::iink::String::operator= ( String &&  other)

Move assigns the other string to this string.

Parameters
otherthe string to move.
Returns
a reference to this string.

◆ isUtf8()

bool myscript::iink::String::isUtf8 ( ) const

Tells whether the internal representation of this string is UTF-8. Deprecated since 3.2. Always returns true.

Returns
true if the internal representation is UTF-8.

◆ isUtf16()

bool myscript::iink::String::isUtf16 ( ) const

Tells whether the internal representation of this string is UTF-16. Deprecated since 3.2. Always returns false.

Returns
true if the internal representation is UTF-16.

◆ isEmpty()

bool myscript::iink::String::isEmpty ( ) const

Tells whether this string is empty.

Returns
true if this string is empty.

◆ size()

size_t myscript::iink::String::size ( ) const

Returns the number of bytes in this string.

Returns
the size of the UTF-8 representation.
Since
3.2

◆ c_str()

const char * myscript::iink::String::c_str ( ) const

Returns a pointer to a null-terminated UTF-8 character array with data equivalent to those stored in this string. The pointer obtained will be invalidated by any modification to this string.

Returns
a non-modifiable UTF-8 character array version of the string.
Since
3.2

◆ toUtf8()

String myscript::iink::String::toUtf8 ( ) const

Returns a UTF-8 copy of this string. Deprecated since 3.2. Same as copy constructor.

Returns
a copy of this string with UTF-8 internal representation.

◆ toUtf16()

String myscript::iink::String::toUtf16 ( ) const

Returns a copy of this string. Deprecated since 3.2. Same as copy constructor.

Returns
a copy of this string.

◆ asUtf8()

const std::string & myscript::iink::String::asUtf8 ( ) const

Returns this string as a const std::string reference.

Returns
a const std::string reference to this string.
Since
3.2

◆ operator std::string()

myscript::iink::String::operator std::string ( ) const

Converts this string as a std::string.

Returns
a std::string copy.

◆ operator std::u16string()

myscript::iink::String::operator std::u16string ( ) const
explicit

Converts this string as a std::u16string.

Returns
a std::u16string copy.

◆ compare() [1/5]

int myscript::iink::String::compare ( const char *  other) const

◆ compare() [2/5]

int myscript::iink::String::compare ( const std::string &  other) const

◆ compare() [3/5]

int myscript::iink::String::compare ( const char16_t *  other) const

◆ compare() [4/5]

int myscript::iink::String::compare ( const std::u16string &  other) const

◆ compare() [5/5]

int myscript::iink::String::compare ( const String &  other) const

◆ operator==()

bool myscript::iink::String::operator== ( const String &  other) const

◆ operator!=()

bool myscript::iink::String::operator!= ( const String &  other) const

◆ operator<()

bool myscript::iink::String::operator< ( const String &  other) const

◆ operator<=()

bool myscript::iink::String::operator<= ( const String &  other) const

◆ operator>()

bool myscript::iink::String::operator> ( const String &  other) const

◆ operator>=()

bool myscript::iink::String::operator>= ( const String &  other) const

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