String Class Reference

#include <c4d_string.h>

Detailed Description

A String is a variable-length sequence of UTF-32 encoded Unicode characters. String provides methods and operators to simplify using character sequences.

Note
Cinema 4D strings are fully using UTF-32 Unicode characters. To avoid problems with Unicodes try to always use Utf32Char in your code unless you need to interface with the system or existing libraries.

Classes

class  PChar
 

Private Attributes

Int32 dummy1
 
Int32 dummy2
 
void * dummy3
 
void * dummy4
 

Constructors/Destructors

 String ()
 
 String (const String &cs)
 
 String (const Utf16Char *s, Int count=-1)
 
 String (const Utf32Char *s, Int count=-1)
 
 String (const Char *cstr, STRINGENCODING type=STRINGENCODING_XBIT)
 
 String (Int count, Utf32Char fillch)
 
 ~String (void)
 

Miscellaneous

void CopyTo (String *str) const
 
Int32 GetLength () const
 
Bool Content () const
 

Operators

const Stringoperator= (const String &cs)
 
const Stringoperator+= (const String &str)
 
Bool operator< (const String &str) const
 
Bool operator> (const String &str) const
 
Bool operator<= (const String &str) const
 
Bool operator>= (const String &str) const
 
Bool operator== (const String &str) const
 
Bool operator!= (const String &str) const
 
Bool operator== (const Char *str) const
 
Bool operator!= (const Char *str) const
 
const String operator+ (const String &str1, const String &str2)
 

Comparison

Int Compare (const String &cs) const
 
Int LexCompare (const String &cs) const
 
Int RelCompare (const String &cs) const
 
Int ComparePart (const String &str, Int cnt, Int pos) const
 
Int LexComparePart (const String &str, Int cnt, Int pos) const
 

Find

Bool FindFirst (const String &cs, Int32 *pos, Int start=0) const
 
Bool FindLast (const String &cs, Int32 *pos, Int start=-1) const
 
Bool FindFirst (Utf32Char ch, Int32 *pos, Int start=0) const
 
Bool FindLast (Utf32Char ch, Int32 *pos, Int start=-1) const
 
Bool FindFirstUpper (const String &findupper, Int32 *pos, Int start) const
 
Bool FindLastUpper (const String &findupper, Int32 *pos, Int start) const
 

Delete/Insert/SubStr

void Delete (Int pos, Int count)
 
void Insert (Int pos, Utf32Char ch)
 
void Insert (Int pos, const String &cs, Int start=-1, Int end=-1)
 
String SubStr (Int start, Int count) const
 
String Left (Int count) const
 
String Right (Int count) const
 

Parse to Number

Float ParseToFloat (Int32 *error=nullptr, Int unit=0, Int angletype=0, Int base=10) const
 
Int32 ParseToInt32 (Int32 *error=nullptr) const
 

Conversion from Number

static String MemoryToString (Int64 mem)
 
static String HexToString (UInt32 v, Bool prefix0x=true)
 
static String HexToString (UInt64 v, Bool prefix0x=true)
 
static String IntToString (Int32 l)
 
static String IntToString (Int64 l)
 
static String UIntToString (UInt32 l)
 
static String UIntToString (UInt64 l)
 
static String FloatToString (Float32 v, Int32 vvk=-1, Int32 nnk=-1, Bool e=false, Utf32Char xchar='0')
 
static String FloatToString (Float64 v, Int32 vvk=-1, Int32 nnk=-1, Bool e=false, Utf32Char xchar='0')
 
static String VectorToString (const Vector32 &v, Int32 nnk=-1)
 
static String VectorToString (const Vector64 &v, Int32 nnk=-1)
 

Conversion to Number

Int32 ToInt32 (Bool *error=nullptr) const
 
Int64 ToInt64 (Bool *error=nullptr) const
 
UInt32 ToUInt32 (Bool *error=nullptr) const
 
UInt64 ToUInt64 (Bool *error=nullptr) const
 
Float ToFloat (Bool *error=nullptr) const
 
Int ToInt (Bool *error=nullptr) const
 
UInt ToUInt (Bool *error=nullptr) const
 

Conversion to Upper/Lower Case

String ToUpper () const
 
String ToLower () const
 

C and Unicode String Conversion

Int32 GetCStringLen (STRINGENCODING type=STRINGENCODING_XBIT) const
 
Int32 GetCString (Char *scstr, Int max, STRINGENCODING type=STRINGENCODING_XBIT) const
 
CharGetCStringCopy (STRINGENCODING type=STRINGENCODING_XBIT) const
 
void SetCString (const Char *cstr, Int count=-1, STRINGENCODING type=STRINGENCODING_XBIT)
 
Bool SetUtf16 (const Utf16Char *ubc, Int count)
 
Bool SetUtf32 (const Utf32Char *ubc, Int count)
 
Bool GetUtf16 (maxon::BaseArray< Utf16Char > &dst)
 
Bool GetUtf32 (maxon::BaseArray< Utf32Char > &dst)
 
const PChar operator[] (Int pos) const
 
PChar operator[] (Int pos)
 

Constructor & Destructor Documentation

§ String() [1/6]

String ( )

Default constructor.

§ String() [2/6]

String ( const String cs)

Copy constructor.

Parameters
[in]csThis String's characters are used to construct the String.

§ String() [3/6]

String ( const Utf16Char s,
Int  count = -1 
)
explicit

Constructs a string with the UTF-16 encoded Unicode characters in s.

Since
R17.032
Parameters
[in]sThe Unicode character array to initialize the string from. The pointed array is copied.
[in]countThe number of Utf16Char characters. If -1 is passed all characters will be copied until '\0' is found.
Note that the string may have a different length than what you specify here as the UTF-16 encoding is transformed into a UTF-32 encoding.

§ String() [4/6]

String ( const Utf32Char s,
Int  count = -1 
)
explicit

Constructs a string with the UTF-32 encoded Unicode characters in s.

Since
R17.032
Parameters
[in]sThe Unicode character array to initialize the string from. The pointed array is copied.
[in]countThe number of Utf32Char characters. If -1 is passed all characters will be copied until '\0' is found. Otherwise the resulting string length will match the given count.

§ String() [5/6]

String ( const Char cstr,
STRINGENCODING  type = STRINGENCODING_XBIT 
)

Constructs a String with the characters in cstr.

Parameters
[in]cstrThe character array to initialize the string with. The passed data is decoded using type to UTF-32 internally.
[in]typeThe string encoding used to interpret cstr.

§ String() [6/6]

String ( Int  count,
Utf32Char  fillch 
)

Constructs a string filled with the same character.

Parameters
[in]countThe number of characters.
[in]fillchThe fill character.

§ ~String()

~String ( void  )

Destructor.

Member Function Documentation

§ CopyTo()

void CopyTo ( String str) const

Copies the string characters to another String object.

Parameters
[in]strThe destination string to copy to. The caller owns the pointed string.

§ GetLength()

Int32 GetLength ( void  ) const

Gets the number of characters in the string.

Returns
The number of characters in the string.

§ Content()

Bool Content ( void  ) const

Checks if the string has any characters in it.

Returns
true if the string is not empty, otherwise false.

§ operator=()

const String& operator= ( const String cs)

Assigns the characters from cs.

Warning
The assignment operators makes string copies.
Parameters
[in]csThe source string to assign.
Returns
The string that was set. Assigned to the left-hand operand.

§ operator+=()

const String& operator+= ( const String str)

Concatenates the strings and sets the left-hand operand to the result.

Warning
The assignment operators makes string copies.
Parameters
[in]strThe right-hand operand string.
Returns
The concatenated string. Assigned to the left-hand operand.

§ operator<()

Bool operator< ( const String str) const

Compares the strings to see if the the left-hand string is less than the right-hand string.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
The result of the comparison.

§ operator>()

Bool operator> ( const String str) const

Compares the strings to see if the the left-hand string is greater than the right-hand string.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
The result of the comparison.

§ operator<=()

Bool operator<= ( const String str) const

Compares the strings to see if the the left-hand string is less than or the same as right-hand string.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
The result of the comparison.

§ operator>=()

Bool operator>= ( const String str) const

Compares the strings to see if the left-hand string is greater than or the same as the right-hand string.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
The result of the comparison.

§ operator==() [1/2]

Bool operator== ( const String str) const

Checks if the strings are equal.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
true if the strings are equal, otherwise false.

§ operator!=() [1/2]

Bool operator!= ( const String str) const

Checks if two strings are different.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
true if the two strings are different, otherwise false.

§ operator==() [2/2]

Bool operator== ( const Char str) const

Checks if the strings are equal.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
true if the strings are equal, otherwise false.

§ operator!=() [2/2]

Bool operator!= ( const Char str) const

Checks if two strings are different.

Note
The comparison is done alphanumerically and case-sensitive.
Parameters
[in]strThe right-hand operand string.
Returns
true if the two strings are different, otherwise false.

§ Compare()

Int Compare ( const String cs) const

Compare the strings and returns their relationship.

Note
Comparison is case sensitive.
Parameters
[in]csThe string to compare against.
Returns
0 if the strings are identical, < 0 if the string is less than cs, or > 0 if the string is greater than cs.

§ LexCompare()

Int LexCompare ( const String cs) const

Compares the String object with another string and returns their relationship.

Note
Comparison is case insensitive. Special characters (ASCII value >= 128) are not handled case-insensitive (like 'Ö', 'ä', 'ß').
Parameters
[in]csThe string to compare against.
Returns
0 if the strings are identical, < 0 if the string is less than cs, or > 0 if the string is greater than cs.

§ RelCompare()

Int RelCompare ( const String cs) const

Incremental compare: the bigger the absolute return value, the bigger the difference.

Parameters
[in]csThe string to compare against.
Returns
0 if the strings are identical, < 0 if the string is less than cs, or > 0 if this string is greater than cs.

§ ComparePart()

Int ComparePart ( const String str,
Int  cnt,
Int  pos 
) const

Compares a part of the string, specified by the position pos and the length cnt, with str.
Equivalent to SubStr(pos, cnt).Compare(str).

Parameters
[in]strThe string to compare against.
[in]cntThe number of characters of the part.
[in]posThe position of the part.
Returns
0 if the strings are identical, < 0 if the string is less than str, or > 0 if the string is greater than str.

§ LexComparePart()

Int LexComparePart ( const String str,
Int  cnt,
Int  pos 
) const

Compares a part of the string, specified by the position pos and the length cnt, with str and returns their relationship.
Equivalent to SubStr(pos, cnt).LexCompare(str).

Note
Comparison is case insensitive. Special characters (ASCII value >= 128) are not handled case-insensitive (like 'Ö', 'ä', 'ß').
Parameters
[in]strThe string to compare against.
[in]cntThe number of characters of the part.
[in]posThe position of the part.
Returns
0 if the strings are identical, < 0 if the string is less than str, or > 0 if the string is greater than str.

§ FindFirst() [1/2]

Bool FindFirst ( const String cs,
Int32 pos,
Int  start = 0 
) const

Searches the string for the first match of the substring.

Parameters
[in]csSubstring to search for.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe starting position in the string for the search: 0 <= start < GetLength().
Returns
true if the substring was found, otherwise false.

§ FindLast() [1/2]

Bool FindLast ( const String cs,
Int32 pos,
Int  start = -1 
) const

Searches the string for the last match of the substring.

Parameters
[in]csThe substring to search for.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe position to start from when searching backwards: 0 <= start < GetLength() or -1 for the end.
Returns
true if the substring was found, otherwise false.

§ FindFirst() [2/2]

Bool FindFirst ( Utf32Char  ch,
Int32 pos,
Int  start = 0 
) const

Searches the string for the first match of character ch.

Parameters
[in]chThe character to find.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe starting position in the string for the search: 0 <= start < GetLength().
Returns
true if the character was found, otherwise false.

§ FindLast() [2/2]

Bool FindLast ( Utf32Char  ch,
Int32 pos,
Int  start = -1 
) const

Searches the string for the last match of character ch.

Parameters
[in]chThe character to find.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe position to start from when searching backwards: 0 <= start < GetLength() or -1 for the end.
Returns
true if the character was found, otherwise false.

§ FindFirstUpper()

Bool FindFirstUpper ( const String findupper,
Int32 pos,
Int  start 
) const

Searches the string for the first match of the upper-case substring.

Warning
findupper has to be uppercase.
Parameters
[in]findupperThe upper-case substring to search for.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe starting position in the string for the search: 0 <= start < GetLength().
Returns
true if the upper-case substring was found, otherwise false.

§ FindLastUpper()

Bool FindLastUpper ( const String findupper,
Int32 pos,
Int  start 
) const

Searches the string for the last match of the upper-case substring.

Warning
findupper has to be uppercase.
Parameters
[in]findupperThe upper-case substring to search for.
[out]posA pointer to an Int32 to receive the found position in the string. The caller owns the pointed integer.
[in]startThe position to start from when searching backwards: 0 <= start < GetLength() or -1 for the end.
Returns
true if the upper-case substring was found, otherwise false.

§ Delete()

void Delete ( Int  pos,
Int  count 
)

Removes a section from the string.

Parameters
[in]posThe starting position to remove: 0 <= pos < GetLength().
[in]countThe number of characters to remove: 0 <= count < GetLength()-pos.

§ Insert() [1/2]

void Insert ( Int  pos,
Utf32Char  ch 
)

Inserts a character into the string.

Parameters
[in]posThe position to insert the character: 0 <= pos < GetLength().
[in]chThe character to insert.

§ Insert() [2/2]

void Insert ( Int  pos,
const String cs,
Int  start = -1,
Int  end = -1 
)

Inserts another string into the string.

Parameters
[in]posThe position to insert the string: 0 <= pos < GetLength().
[in]csThe string to insert.
[in]startThe start position within the inserted string to only insert parts of the string.
[in]endEnd position within the inserted string to only insert parts of the string.

§ SubStr()

String SubStr ( Int  start,
Int  count 
) const

Extracts a substring from the string.

Parameters
[in]startThe position to extract the substring from. Must be 0 <= pos < GetLength().
[in]countThe number of characters of the substring: 0 <= count < GetLength()-start
Returns
The substring.

§ Left()

String Left ( Int  count) const

Extracts a substring from the left of the string.

Parameters
[in]countThe number of characters of the substring: 0 <= count < GetLength()
Returns
The substring.

§ Right()

String Right ( Int  count) const

Extracts a substring from the right of the string.

Parameters
[in]countThe number of characters of the substring: 0 <= count < GetLength()
Returns
The substring.

§ ParseToFloat()

Float ParseToFloat ( Int32 error = nullptr,
Int  unit = 0,
Int  angletype = 0,
Int  base = 10 
) const

Converts the string into a Float value.

Parameters
[in]errorA pointer to an Int32 to report any errors of conversion. The caller owns the pointed variable.
The function succeeded if error==0.
[in]unitThe unit type: UNIT
[in]angletypeThe angle type: ANGLE
[in]baseThe base of the number system used in the string.
Returns
The Float value represented by the string.

§ ParseToInt32()

Int32 ParseToInt32 ( Int32 error = nullptr) const

Converts the string into an Int32 value.

Parameters
[in]errorA pointer to an Int32 to report any errors of conversion. The caller owns the pointed variable.
The function succeeded if error==0.
Returns
The Int32 value represented by the string.

§ MemoryToString()

static String MemoryToString ( Int64  mem)
static

Converts a Int64 into a memory size formated (B,KB,MB) string.

Parameters
[in]memThe Int64 memory value to convert.
Returns
The Int64 memory as a string.

§ HexToString() [1/2]

static String HexToString ( UInt32  v,
Bool  prefix0x = true 
)
static

Converts a UInt32 hexadecimal value into a string (usually used with pointers).

Parameters
[in]vThe hexadecimal value to convert.
[in]prefix0xSet to false to disable '0x' prefix in the returned string.
Returns
The hexadecimal value as a string.

§ HexToString() [2/2]

static String HexToString ( UInt64  v,
Bool  prefix0x = true 
)
static

Converts a UInt64 hexadecimal value into a string (usually used with pointers).

Parameters
[in]vThe hexadecimal value to convert.
[in]prefix0xSet to false to disable '0x' prefix in the returned string.
Returns
The hexadecimal value as a string.

§ IntToString() [1/2]

static String IntToString ( Int32  l)
static

Converts an Int32 to a String.

Parameters
[in]lThe Int32 value to convert.
Returns
The Int32 as a string.

§ IntToString() [2/2]

static String IntToString ( Int64  l)
static

Converts an Int64 to a String.

Parameters
[in]lThe Int64 value to convert.
Returns
The Int64 as a string.

§ UIntToString() [1/2]

static String UIntToString ( UInt32  l)
static

Converts a UInt32 to a String.

Parameters
[in]lThe UInt32 value to convert.
Returns
The UInt32 as a string.

§ UIntToString() [2/2]

static String UIntToString ( UInt64  l)
static

Converts a UInt64 to a String.

Parameters
[in]lThe UInt64 value to convert.
Returns
The UInt64 as a string.

§ FloatToString() [1/2]

static String FloatToString ( Float32  v,
Int32  vvk = -1,
Int32  nnk = -1,
Bool  e = false,
Utf32Char  xchar = '0' 
)
static

Converts a Float32 into a String.

Parameters
[in]vThe Float32 value to convert.
[in]vvkThe number of digits in front of the comma.
[in]nnkThe number of digits after the comma.
[in]eSet to true to use exponential writing.
[in]xcharThe leading chars will be filled with this character. e.g. the value 100 with vvk==5 will looks like this: 00100.
Returns
The Float32 as a string.

§ FloatToString() [2/2]

static String FloatToString ( Float64  v,
Int32  vvk = -1,
Int32  nnk = -1,
Bool  e = false,
Utf32Char  xchar = '0' 
)
static

Converts a Float64 into a String.

Parameters
[in]vThe Float64 value to convert.
[in]vvkThe number of digits in front of the comma.
[in]nnkThe number of digits after the comma.
[in]eSet to true to use exponential writing.
[in]xcharThe leading chars will be filled with this character. e.g. the value 100 with vvk==5 will looks like this: 00100.
Returns
The Float64 as a string.

§ VectorToString() [1/2]

static String VectorToString ( const Vector32 v,
Int32  nnk = -1 
)
static

Converts a Vector32 into a String.

Parameters
[in]vThe Vector32 value to convert.
[in]nnkThe number of digits after the comma.
Returns
The Vector32 as a string.

§ VectorToString() [2/2]

static String VectorToString ( const Vector64 v,
Int32  nnk = -1 
)
static

Converts a Vector64 into a String.

Parameters
[in]vThe Vector64 value to convert.
[in]nnkThe number of digits after the comma.
Returns
The Vector64 as a string.

§ ToInt32()

Int32 ToInt32 ( Bool error = nullptr) const

Converts the string to an Int32.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as an Int32.

§ ToInt64()

Int64 ToInt64 ( Bool error = nullptr) const

Converts the string to an Int64.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as an Int64.

§ ToUInt32()

UInt32 ToUInt32 ( Bool error = nullptr) const

Converts the string to a UInt32.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as a UInt32.

§ ToUInt64()

UInt64 ToUInt64 ( Bool error = nullptr) const

Converts the string to a UInt64.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as a UInt64.

§ ToFloat()

Float ToFloat ( Bool error = nullptr) const

Converts the string to a Float.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as a Float.

§ ToInt()

Int ToInt ( Bool error = nullptr) const

Converts the string to an Int.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as an Int.

§ ToUInt()

UInt ToUInt ( Bool error = nullptr) const

Converts the string to a UInt.

Parameters
[out]errorAssigned true if an error occurred, otherwise false.
Returns
The string as a UInt.

§ ToUpper()

String ToUpper ( ) const

Converts the characters of the string to uppercase.

Warning
This only works with ANSI characters less than character code 128, all other characters remain unchanged.
Returns
The converted uppercase string. Returns a copy of the string.

§ ToLower()

String ToLower ( ) const

Converts the characters of the string to lowercase.

Warning
This only works with ANSI characters less than character code 128, all other characters remain unchanged.
Returns
The converted lowercase string. Returns a copy of the string.

§ GetCStringLen()

Int32 GetCStringLen ( STRINGENCODING  type = STRINGENCODING_XBIT) const

Gets the expected length of the string after encoding.

Parameters
[in]typeThe type of string encoding.
Returns
The length of the encoded string.

§ GetCString()

Int32 GetCString ( Char scstr,
Int  max,
STRINGENCODING  type = STRINGENCODING_XBIT 
) const

Gets the string after encoding. This routine can be used to convert Cinema 4D Unicode strings into standard C strings.

Parameters
[out]scstrThe buffer for the encoded string. The size of the buffer must be at least max. The caller owns the pointed buffer.. It is guaranteed that the character sequence will be '\0'-terminated.
[in]maxThe maximum number of characters for the buffer scstr. Should be GetCStringLen() + 1, otherwise the string will be truncated.
[in]typeThe type of string encoding.
Returns
The length of the encoded string.

§ GetCStringCopy()

Char* GetCStringCopy ( STRINGENCODING  type = STRINGENCODING_XBIT) const

Gets the encoded string as a copy. This routine can be used to convert Cinema 4D Unicode strings into standard C strings. Other than GetCString() no length precalculation needs to be done.

Parameters
[in]typeThe type of string encoding.
Returns
The C string copy of the string. The caller owns the pointed string.
Warning
The returned character buffer has to be freed after usage with DeleteMem().

§ SetCString()

void SetCString ( const Char cstr,
Int  count = -1,
STRINGENCODING  type = STRINGENCODING_XBIT 
)

Sets a string. This routine will convert a standard C string using the given decoding into a Cinema 4D UTF-32 Unicode string.

Parameters
[in]cstrThe buffer containing the encoded string. The caller owns the pointed buffer.
[in]countThe number of characters in the encoded string. If -1 is passed all characters will be copied until '\0' is found.
Note that the resulting string may have a different length than what you specify here it is transformed into a UTF-32 encoding.
[in]typeThe type of string encoding.

§ SetUtf16()

Bool SetUtf16 ( const Utf16Char ubc,
Int  count 
)

Sets UTF-16 Unicode data into the string.

Since
R17.032
Parameters
[in]ubcThe buffer with the UTF-16 Unicode data to set. The caller owns the pointed buffer.
[in]countThe number of characters in the encoded string. If -1 is passed all characters will be copied until '\0' is found.
Note that the resulting string may have a different length than what you specify here it is transformed into a UTF-32 encoding.
Returns
true if successful, otherwise false.

§ SetUtf32()

Bool SetUtf32 ( const Utf32Char ubc,
Int  count 
)

Sets UTF-32 Unicode data into the string directly.

Since
R17.032
Parameters
[in]ubcThe buffer with the UTF-32 Unicode data to set. The caller owns the pointed buffer.
[in]countThe number of Utf32Char characters. If -1 is passed all characters will be copied until '\0' is found. Otherwise the resulting string length will match the given count.
Returns
true if successful, otherwise false.

§ GetUtf16()

Bool GetUtf16 ( maxon::BaseArray< Utf16Char > &  dst)

Gets the string data as a UTF-16 encoded character array.

Since
R17.032
Parameters
[out]dstThe buffer to be filled with the UTF-16 Unicode data. The data will not be '\0' terminated.
Returns
true if successful, otherwise false.

§ GetUtf32()

Bool GetUtf32 ( maxon::BaseArray< Utf32Char > &  dst)

Gets the string data as a UTF-32 encoded character array.

Since
R17.032
Parameters
[out]dstThe buffer to be filled with the UTF-16 Unicode data. The data will not be '\0' terminated.
Returns
true if successful, otherwise false.

§ operator[]() [1/2]

const PChar operator[] ( Int  pos) const

Get/Set OperatorsGets a constant Unicode character from the string at position pos.

Parameters
[in]posPosition within the string to get the character at. Must be 0 <= Pos < GetLength().
Returns
The character.

§ operator[]() [2/2]

PChar operator[] ( Int  pos)

Gets a non-constant Unicode character from the string at position pos. This makes it possible to assign to a character position:

String s("Hello World!");
s[1] = 'a';
Parameters
[in]posPosition within the string to get the character at. Must be 0 <= Pos < GetLength().
Returns
The character.

Friends And Related Function Documentation

§ operator+

const String operator+ ( const String str1,
const String str2 
)
friend

Concatenates the strings and returns the resulting string.

Parameters
[in]str1The left-hand operand string.
[in]str2The right-hand operand string.
Returns
The concatenated string.

Member Data Documentation

§ dummy1

Int32 dummy1
private

§ dummy2

Int32 dummy2
private

§ dummy3

void* dummy3
private

§ dummy4

void* dummy4
private