Base Module: String Class Reference
Author: Steinberg

Base Module VST 3.7 SDK for developing VST plug-in

Public Types | Public Member Functions | Protected Member Functions | List of all members
String Class Reference

String. More...

`#include <fstring.h>`

Inheritance diagram for String:

## Public Types
enum | CharGroup { kSpace , kNotAlphaNum , kNotAlpha }
Public Types inherited from ConstString
enum | CompareMode { kCaseSensitive , kCaseInsensitive }

## Public Member Functions
| String ()
| String (const char8 *str, MBCodePage codepage, int32 n=-1, bool isTerminated=true)
| assign n characters of str and convert to wide string by using the specified codepage More...
| String (const char8 *str, int32 n=-1, bool isTerminated=true)
| assign n characters of str (-1: all) More...
| String (const char16 *str, int32 n=-1, bool isTerminated=true)
| assign n characters of str (-1: all) More...
| String (const String &str, int32 n=-1)
| assign n characters of str (-1: all) More...
| String (const ConstString &str, int32 n=-1)
| assign n characters of str (-1: all) More...
| String (const FVariant &var)
| assign from FVariant More...
| String (IString *str)
| assign from IString More...
| ~String () SMTG_OVERRIDE
void | updateLength ()
| Call this when the string is truncated outside (not recommended though) More...
const char8 * | text8 () const SMTG_OVERRIDE
const char16 * | text16 () const SMTG_OVERRIDE
char8 | getChar8 (uint32 index) const SMTG_OVERRIDE
char16 | getChar16 (uint32 index) const SMTG_OVERRIDE
bool | setChar8 (uint32 index, char8 c)
bool | setChar16 (uint32 index, char16 c)
bool | setChar (uint32 index, char8 c)
bool | setChar (uint32 index, char16 c)
String & | operator= (const char8 *str)
| Assign from a string of type char8. More...
String & | operator= (const char16 *str)
String & | operator= (const ConstString &str)
String & | operator= (const String &str)
String & | operator= (char8 c)
String & | operator= (char16 c)
String & | assign (const ConstString &str, int32 n=-1)
| Assign n characters of str (-1: all) More...
String & | assign (const char8 *str, int32 n=-1, bool isTerminated=true)
| Assign n characters of str (-1: all) More...
String & | assign (const char16 *str, int32 n=-1, bool isTerminated=true)
| Assign n characters of str (-1: all) More...
String & | assign (char8 c, int32 n=1)
String & | assign (char16 c, int32 n=1)
String & | append (const ConstString &str, int32 n=-1)
| Append n characters of str to this (n=-1: all) More...
String & | append (const char8 *str, int32 n=-1)
| Append n characters of str to this (n=-1: all) More...
String & | append (const char16 *str, int32 n=-1)
| Append n characters of str to this (n=-1: all) More...
String & | append (const char8 c, int32 n=1)
| Append char c n times. More...
String & | append (const char16 c, int32 n=1)
| Append char c n times. More...
String & | insertAt (uint32 idx, const ConstString &str, int32 n=-1)
| Insert n characters of str at position idx (n=-1: all) More...
String & | insertAt (uint32 idx, const char8 *str, int32 n=-1)
| Insert n characters of str at position idx (n=-1: all) More...
String & | insertAt (uint32 idx, const char16 *str, int32 n=-1)
| Insert n characters of str at position idx (n=-1: all) More...
String & | insertAt (uint32 idx, char8 c)
String & | insertAt (uint32 idx, char16 c)
String & | operator+= (const String &str)
String & | operator+= (const ConstString &str)
String & | operator+= (const char8 *str)
String & | operator+= (const char16 *str)
String & | operator+= (const char8 c)
String & | operator+= (const char16 c)
String & | replace (uint32 idx, int32 n1, const ConstString &str, int32 n2=-1)
| Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end) More...
String & | replace (uint32 idx, int32 n1, const char8 *str, int32 n2=-1)
| Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end) More...
String & | replace (uint32 idx, int32 n1, const char16 *str, int32 n2=-1)
| Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end) More...
int32 | replace (const char8 *toReplace, const char8 *toReplaceWith, bool all=false, CompareMode m=kCaseSensitive)
| Replace find string with replace string - returns number of replacements. More...
int32 | replace (const char16 *toReplace, const char16 *toReplaceWith, bool all=false, CompareMode m=kCaseSensitive)
| Replace find string with replace string - returns number of replacements. More...
bool | replaceChars8 (const char8 *toReplace, char8 toReplaceBy)
| Returns true when any replacement was done. More...
bool | replaceChars16 (const char16 *toReplace, char16 toReplaceBy)
bool | replaceChars8 (char8 toReplace, char8 toReplaceBy)
bool | replaceChars16 (char16 toReplace, char16 toReplaceBy)
bool | replaceChars (char8 toReplace, char8 toReplaceBy)
bool | replaceChars (char16 toReplace, char16 toReplaceBy)
bool | replaceChars (const char8 *toReplace, char8 toReplaceBy)
bool | replaceChars (const char16 *toReplace, char16 toReplaceBy)
String & | remove (uint32 index=0, int32 n=-1)
| Remove n characters from string starting at index (n=-1: until end) More...
bool | trim (CharGroup mode=kSpace)
| Trim lead/trail. More...
void | removeChars (CharGroup mode=kSpace)
| Removes all of group. More...
bool | removeChars8 (const char8 *which)
| Remove all occurrences of each char in 'which'. More...
bool | removeChars16 (const char16 *which)
| Remove all occurrences of each char in 'which'. More...
bool | removeChars8 (const char8 which)
bool | removeChars16 (const char16 which)
bool | removeChars (const char8 *which)
bool | removeChars (const char16 *which)
bool | removeChars (const char8 which)
bool | removeChars (const char16 which)
bool | removeSubString (const ConstString &subString, bool allOccurences=true)
String & | printf (const char8 *format,...)
| Print formatted data into string. More...
String & | printf (const char16 *format,...)
| Print formatted data into string. More...
String & | vprintf (const char8 *format, va_list args)
String & | vprintf (const char16 *format, va_list args)
String & | printInt64 (int64 value)
String & | printFloat (double value, uint32 maxPrecision=6)
| print a float into a string, trailing zeros will be trimmed More...
bool | incrementTrailingNumber (uint32 width=2, char separator=STR(' '), uint32 minNumber=1, bool applyOnlyFormat=false)
| Increment the trailing number if present else start with minNumber, width specifies the string width format (width 2 for number 3 is 03), applyOnlyFormat set to true will only format the string to the given width without incrementing the founded trailing number. More...
bool | fromVariant (const FVariant &var)
| Assigns string from FVariant. More...
void | toVariant (FVariant &var) const
bool | fromAttributes (IAttributes *a, IAttrID attrID)
| Assigns string from FAttributes. More...
bool | toAttributes (IAttributes *a, IAttrID attrID)
void | swapContent (String &s)
| Swaps ownership of the strings pointed to. More...
void | take (String &str)
| Take ownership of the string of 'str'. More...
void | take (void *_buffer, bool wide)
| Take ownership of buffer. More...
void * | pass ()
void | passToVariant (FVariant &var)
| Pass ownership of buffer to Variant - sets Variant ownership. More...
void | toLower (uint32 index)
| Lower case the character. More...
void | toLower ()
| Lower case the string. More...
void | toUpper (uint32 index)
| Upper case the character. More...
void | toUpper ()
| Upper case the string. More...
unsigned char * | toPascalString (unsigned char *buf)
| Pascal string conversion. More...
const String & | fromPascalString (const unsigned char *buf)
| Pascal string conversion. More...
bool | toWideString (uint32 sourceCodePage=kCP_Default)
| Converts to wide string according to sourceCodePage. More...
bool | toMultiByte (uint32 destCodePage=kCP_Default)
void | fromUTF8 (const char8 *utf8String)
| Assigns from UTF8 string. More...
bool | normalize (UnicodeNormalization=kUnicodeNormC)
| On PC only kUnicodeNormC is working. More...
Public Member Functions inherited from ConstString
| ConstString (const char8 *str, int32 length=-1)
| Assign from string of type char8 (length=-1: all) More...
| ConstString (const char16 *str, int32 length=-1)
| Assign from string of type char16 (length=-1: all) More...
| ConstString (const ConstString &str, int32 offset=0, int32 length=-1)
| Copy constructor (length=-1: all). More...
| ConstString (const FVariant &var)
| Assign a string from FVariant. More...
| ConstString ()
virtual | ~ConstString ()
| Destructor. More...
virtual int32 | length () const
| Return length of string. More...
bool | isEmpty () const
| Return true if string is empty. More...
| operator const char8 * () const
| Returns pointer to string of type char8 (no modification allowed) More...
| operator const char16 * () const
| Returns pointer to string of type char16(no modification allowed) More...
char | operator[] (short idx) const
| Returns character at 'idx'. More...
char | operator[] (long idx) const
char | operator[] (int idx) const
char | operator[] (unsigned short idx) const
char | operator[] (unsigned long idx) const
char | operator[] (unsigned int idx) const
virtual const char8 * | text8 () const
| Returns pointer to string of type char8. More...
virtual const char16 * | text16 () const
| Returns pointer to string of type char16. More...
virtual const char * | text () const
| Returns pointer to string of type tchar. More...
virtual const void * | ptr () const
| Returns pointer to string of type void. More...
virtual char8 | getChar8 (uint32 index) const
| Returns character of type char16 at 'index'. More...
virtual char16 | getChar16 (uint32 index) const
| Returns character of type char8 at 'index'. More...
char | getChar (uint32 index) const
| Returns character of type tchar at 'index'. More...
char | getCharAt (uint32 index) const
| Returns character of type tchar at 'index', no conversion! More...
bool | testChar8 (uint32 index, char8 c) const
| Returns true if character is equal at position 'index'. More...
bool | testChar16 (uint32 index, char16 c) const
bool | testChar (uint32 index, char8 c) const
bool | testChar (uint32 index, char16 c) const
bool | extract (String &result, uint32 idx, int32 n=-1) const
| Get n characters long substring starting at index (n=-1: until end) More...
int32 | copyTo8 (char8 *str, uint32 idx=0, int32 n=-1) const
int32 | copyTo16 (char16 *str, uint32 idx=0, int32 n=-1) const
int32 | copyTo (char *str, uint32 idx=0, int32 n=-1) const
void | copyTo (IStringResult *result) const
| Copies whole member string. More...
void | copyTo (IString &string) const
| Copies whole member string. More...
uint32 | hash (uint32 tsize) const
int32 | compareAt (uint32 index, const ConstString &str, int32 n=-1, CompareMode m=kCaseSensitive) const
| Compare n characters of str with n characters of this starting at index (return: see above) More...
int32 | compare (const ConstString &str, int32 n, CompareMode m=kCaseSensitive) const
| Compare n characters of str with n characters of this (return: see above) More...
int32 | compare (const ConstString &str, CompareMode m=kCaseSensitive) const
| Compare all characters of str with this (return: see above) More...
int32 | naturalCompare (const ConstString &str, CompareMode mode=kCaseSensitive) const
bool | startsWith (const ConstString &str, CompareMode m=kCaseSensitive) const
| Check if this starts with str. More...
bool | endsWith (const ConstString &str, CompareMode m=kCaseSensitive) const
| Check if this ends with str. More...
bool | contains (const ConstString &str, CompareMode m=kCaseSensitive) const
| Check if this contains str More...
int32 | findLast (const ConstString &str, int32 n=-1, CompareMode m=kCaseSensitive) const
| Find last occurrence of n characters of str in this (n=-1: all) More...
int32 | findLast (char8 c, CompareMode m=kCaseSensitive) const
int32 | findLast (char16 c, CompareMode m=kCaseSensitive) const
int32 | countOccurences (char8 c, uint32 startIndex, CompareMode=kCaseSensitive) const
| Counts occurences of c within this starting at index. More...
int32 | countOccurences (char16 c, uint32 startIndex, CompareMode=kCaseSensitive) const
int32 | getFirstDifferent (const ConstString &str, CompareMode=kCaseSensitive) const
| Returns position of first different character. More...
bool | isDigit (uint32 index) const
| Returns true if character at position is a digit. More...
bool | scanFloat (double &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to double value starting at offset. More...
bool | scanInt64 (int64 &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to int64 value starting at offset. More...
bool | scanUInt64 (uint64 &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to uint64 value starting at offset. More...
bool | scanInt32 (int32 &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to int32 value starting at offset. More...
bool | scanUInt32 (uint32 &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to uint32 value starting at offset. More...
bool | scanHex (uint8 &value, uint32 offset=0, bool scanToEnd=true) const
| Converts string to hex/uint8 value starting at offset. More...
int32 | getTrailingNumberIndex (uint32 width=0) const
| Returns start index of trailing number. More...
int64 | getTrailingNumber (int64 fallback=0) const
| Returns result of scanInt64 or the fallback. More...
int64 | getNumber () const
| Returns result of scanInt64. More...
void | toVariant (FVariant &var) const
bool | isWideString () const
| Returns true if string is wide. More...
bool | isAsciiString () const
| Checks if all characters in string are in ascii range. More...
bool | isNormalized (UnicodeNormalization=kUnicodeNormC)
| On PC only kUnicodeNormC is working. More...
int32 | findFirst (const ConstString &str, int32 n=-1, CompareMode m=kCaseSensitive, int32 endIndex=-1) const
int32 | findFirst (char8 c, CompareMode m=kCaseSensitive, int32 endIndex=-1) const
int32 | findFirst (char16 c, CompareMode m=kCaseSensitive, int32 endIndex=-1) const
int32 | findNext (int32 startIndex, const ConstString &str, int32 n=-1, CompareMode=kCaseSensitive, int32 endIndex=-1) const
int32 | findNext (int32 startIndex, char8 c, CompareMode=kCaseSensitive, int32 endIndex=-1) const
int32 | findNext (int32 startIndex, char16 c, CompareMode=kCaseSensitive, int32 endIndex=-1) const
int32 | findPrev (int32 startIndex, const ConstString &str, int32 n=-1, CompareMode=kCaseSensitive) const
int32 | findPrev (int32 startIndex, char8 c, CompareMode=kCaseSensitive) const
int32 | findPrev (int32 startIndex, char16 c, CompareMode=kCaseSensitive) const

## Protected Member Functions
bool | resize (uint32 newSize, bool wide, bool fill=false)

## Additional Inherited Members
Static Public Member Functions inherited from ConstString
static bool | isCharSpace (char8 character)
| Returns true if character is a space. More...
static bool | isCharSpace (char16 character)
| Returns true if character is a space. More...
static bool | isCharAlpha (char8 character)
| Returns true if character is an alphabetic character. More...
static bool | isCharAlpha (char16 character)
| Returns true if character is an alphabetic character. More...
static bool | isCharAlphaNum (char8 character)
| Returns true if character is an alphanumeric character. More...
static bool | isCharAlphaNum (char16 character)
| Returns true if character is an alphanumeric character. More...
static bool | isCharDigit (char8 character)
| Returns true if character is a number. More...
static bool | isCharDigit (char16 character)
| Returns true if character is a number. More...
static bool | isCharAscii (char8 character)
| Returns true if character is in ASCII range. More...
static bool | isCharAscii (char16 character)
| Returns true if character is in ASCII range. More...
static bool | isCharUpper (char8 character)
static bool | isCharUpper (char16 character)
static bool | isCharLower (char8 character)
static bool | isCharLower (char16 character)
static bool | scanInt64_8 (const char8 *text, int64 &value, bool scanToEnd=true)
| Converts string of type char8 to int64 value. More...
static bool | scanInt64_16 (const char16 *text, int64 &value, bool scanToEnd=true)
| Converts string of type char16 to int64 value. More...
static bool | scanInt64 (const char *text, int64 &value, bool scanToEnd=true)
| Converts string of type tchar to int64 value. More...
static bool | scanUInt64_8 (const char8 *text, uint64 &value, bool scanToEnd=true)
| Converts string of type char8 to uint64 value. More...
static bool | scanUInt64_16 (const char16 *text, uint64 &value, bool scanToEnd=true)
| Converts string of type char16 to uint64 value. More...
static bool | scanUInt64 (const char *text, uint64 &value, bool scanToEnd=true)
| Converts string of type tchar to uint64 value. More...
static bool | scanInt32_8 (const char8 *text, int32 &value, bool scanToEnd=true)
| Converts string of type char8 to int32 value. More...
static bool | scanInt32_16 (const char16 *text, int32 &value, bool scanToEnd=true)
| Converts string of type char16 to int32 value. More...
static bool | scanInt32 (const char *text, int32 &value, bool scanToEnd=true)
| Converts string of type tchar to int32 value. More...
static bool | scanUInt32_8 (const char8 *text, uint32 &value, bool scanToEnd=true)
| Converts string of type char8 to int32 value. More...
static bool | scanUInt32_16 (const char16 *text, uint32 &value, bool scanToEnd=true)
| Converts string of type char16 to int32 value. More...
static bool | scanUInt32 (const char *text, uint32 &value, bool scanToEnd=true)
| Converts string of type tchar to int32 value. More...
static bool | scanHex_8 (const char8 *text, uint8 &value, bool scanToEnd=true)
| Converts string of type char8 to hex/unit8 value. More...
static bool | scanHex_16 (const char16 *text, uint8 &value, bool scanToEnd=true)
| Converts string of type char16 to hex/unit8 value. More...
static bool | scanHex (const char *text, uint8 &value, bool scanToEnd=true)
| Converts string of type tchar to hex/unit8 value. More...
static char8 | toLower (char8 c)
| Converts to lower case. More...
static char8 | toUpper (char8 c)
| Converts to upper case. More...
static char16 | toLower (char16 c)
static char16 | toUpper (char16 c)
static int32 | multiByteToWideString (char16 *dest, const char8 *source, int32 wcharCount, uint32 sourceCodePage=kCP_Default)
| If dest is zero, this returns the maximum number of bytes needed to convert source. More...
static int32 | wideStringToMultiByte (char8 *dest, const char16 *source, int32 char8Count, uint32 destCodePage=kCP_Default)
| If dest is zero, this returns the maximum number of bytes needed to convert source. More...
Protected Attributes inherited from ConstString
union {
void * buffer
char8 * buffer8
char16 * buffer16
}; |
uint32 | len: 30
uint32 | isWide: 1

## Detailed Description

String.

Extends class ConstString by operations which allow modifications.

If allocated externally and passed in via take() or extracted via pass(), memory is expected to be allocated with C's malloc() (rather than new) and deallocated with free(). Use the NEWSTR8/16 and DELETESTR8/16 macros below.

See also
  ConstString

## Member Enumeration Documentation

## ◆ CharGroup

enum CharGroup

Enumerator
kSpace |
kNotAlphaNum |
kNotAlpha |

## Constructor & Destructor Documentation

## ◆ String() [1/8]

String | ( |  | ) |

## ◆ String() [2/8]

String | ( | const char8 * | str,
|  | MBCodePage | codepage,
|  | int32 | n = `-1`,
|  | bool | isTerminated = `true`
| ) |  |

assign n characters of str and convert to wide string by using the specified codepage

## ◆ String() [3/8]

String | ( | const char8 * | str,
|  | int32 | n = `-1`,
|  | bool | isTerminated = `true`
| ) |  |

assign n characters of str (-1: all)

## ◆ String() [4/8]

String | ( | const char16 * | str,
|  | int32 | n = `-1`,
|  | bool | isTerminated = `true`
| ) |  |

assign n characters of str (-1: all)

## ◆ String() [5/8]

String | ( | const String & | str,
|  | int32 | n = `-1`
| ) |  |

assign n characters of str (-1: all)

## ◆ String() [6/8]

String | ( | const ConstString & | str,
|  | int32 | n = `-1`
| ) |  |

assign n characters of str (-1: all)

## ◆ String() [7/8]

String | ( | const FVariant & | var | ) |

assign from FVariant

## ◆ String() [8/8]

String | ( | IString * | str | ) |

assign from IString

## ◆ ~String()

~String | ( |  | ) |

## Member Function Documentation

## ◆ updateLength()

void updateLength | ( |  | ) |

Call this when the string is truncated outside (not recommended though)

## ◆ text8()

const char8 * text8 | ( |  | ) | const
| inlinevirtual

Reimplemented from ConstString.

## ◆ text16()

const char16 * text16 | ( |  | ) | const
| inlinevirtual

Reimplemented from ConstString.

## ◆ getChar8()

char8 getChar8 | ( | uint32 | index | ) | const
| inlinevirtual

Reimplemented from ConstString.

## ◆ getChar16()

char16 getChar16 | ( | uint32 | index | ) | const
| inlinevirtual

Reimplemented from ConstString.

## ◆ setChar8()

bool setChar8 | ( | uint32 | index,
|  | char8 | c
| ) |  |

## ◆ setChar16()

bool setChar16 | ( | uint32 | index,
|  | char16 | c
| ) |  |

## ◆ setChar() [1/2]

bool setChar | ( | uint32 | index,
|  | char8 | c
| ) |  |
| inline

## ◆ setChar() [2/2]

bool setChar | ( | uint32 | index,
|  | char16 | c
| ) |  |
| inline

## ◆ operator=() [1/6]

String & operator= | ( | const char8 * | str | ) |
| inline

Assign from a string of type char8.

## ◆ operator=() [2/6]

String & operator= | ( | const char16 * | str | ) |
| inline

## ◆ operator=() [3/6]

String & operator= | ( | const ConstString & | str | ) |
| inline

## ◆ operator=() [4/6]

String & operator= | ( | const String & | str | ) |
| inline

## ◆ operator=() [5/6]

String & operator= | ( | char8 | c | ) |
| inline

## ◆ operator=() [6/6]

String & operator= | ( | char16 | c | ) |
| inline

## ◆ assign() [1/5]

String & assign | ( | const ConstString & | str,
|  | int32 | n = `-1`
| ) |  |

Assign n characters of str (-1: all)

## ◆ assign() [2/5]

String & assign | ( | const char8 * | str,
|  | int32 | n = `-1`,
|  | bool | isTerminated = `true`
| ) |  |

Assign n characters of str (-1: all)

## ◆ assign() [3/5]

String & assign | ( | const char16 * | str,
|  | int32 | n = `-1`,
|  | bool | isTerminated = `true`
| ) |  |

Assign n characters of str (-1: all)

## ◆ assign() [4/5]

String & assign | ( | char8 | c,
|  | int32 | n = `1`
| ) |  |

## ◆ assign() [5/5]

String & assign | ( | char16 | c,
|  | int32 | n = `1`
| ) |  |

## ◆ append() [1/5]

String & append | ( | const ConstString & | str,
|  | int32 | n = `-1`
| ) |  |

Append n characters of str to this (n=-1: all)

## ◆ append() [2/5]

String & append | ( | const char8 * | str,
|  | int32 | n = `-1`
| ) |  |

Append n characters of str to this (n=-1: all)

## ◆ append() [3/5]

String & append | ( | const char16 * | str,
|  | int32 | n = `-1`
| ) |  |

Append n characters of str to this (n=-1: all)

## ◆ append() [4/5]

String & append | ( | const char8 | c,
|  | int32 | n = `1`
| ) |  |

Append char c n times.

## ◆ append() [5/5]

String & append | ( | const char16 | c,
|  | int32 | n = `1`
| ) |  |

Append char c n times.

## ◆ insertAt() [1/5]

String & insertAt | ( | uint32 | idx,
|  | const ConstString & | str,
|  | int32 | n = `-1`
| ) |  |

Insert n characters of str at position idx (n=-1: all)

## ◆ insertAt() [2/5]

String & insertAt | ( | uint32 | idx,
|  | const char8 * | str,
|  | int32 | n = `-1`
| ) |  |

Insert n characters of str at position idx (n=-1: all)

## ◆ insertAt() [3/5]

String & insertAt | ( | uint32 | idx,
|  | const char16 * | str,
|  | int32 | n = `-1`
| ) |  |

Insert n characters of str at position idx (n=-1: all)

## ◆ insertAt() [4/5]

String & insertAt | ( | uint32 | idx,
|  | char8 | c
| ) |  |
| inline

## ◆ insertAt() [5/5]

String & insertAt | ( | uint32 | idx,
|  | char16 | c
| ) |  |
| inline

## ◆ operator+=() [1/6]

String & operator+= | ( | const String & | str | ) |
| inline

## ◆ operator+=() [2/6]

String & operator+= | ( | const ConstString & | str | ) |
| inline

## ◆ operator+=() [3/6]

String & operator+= | ( | const char8 * | str | ) |
| inline

## ◆ operator+=() [4/6]

String & operator+= | ( | const char16 * | str | ) |
| inline

## ◆ operator+=() [5/6]

String & operator+= | ( | const char8 | c | ) |
| inline

## ◆ operator+=() [6/6]

String & operator+= | ( | const char16 | c | ) |
| inline

## ◆ replace() [1/5]

String & replace | ( | uint32 | idx,
|  | int32 | n1,
|  | const ConstString & | str,
|  | int32 | n2 = `-1`
| ) |  |

Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end)

## ◆ replace() [2/5]

String & replace | ( | uint32 | idx,
|  | int32 | n1,
|  | const char8 * | str,
|  | int32 | n2 = `-1`
| ) |  |

Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end)

## ◆ replace() [3/5]

String & replace | ( | uint32 | idx,
|  | int32 | n1,
|  | const char16 * | str,
|  | int32 | n2 = `-1`
| ) |  |

Replace n1 characters of this (starting at idx) with n2 characters of str (n1,n2=-1: until end)

## ◆ replace() [4/5]

int32 replace | ( | const char8 * | toReplace,
|  | const char8 * | toReplaceWith,
|  | bool | all = `false`,
|  | CompareMode | m = `kCaseSensitive`
| ) |  |

Replace find string with replace string - returns number of replacements.

## ◆ replace() [5/5]

int32 replace | ( | const char16 * | toReplace,
|  | const char16 * | toReplaceWith,
|  | bool | all = `false`,
|  | CompareMode | m = `kCaseSensitive`
| ) |  |

Replace find string with replace string - returns number of replacements.

## ◆ replaceChars8() [1/2]

bool replaceChars8 | ( | const char8 * | toReplace,
|  | char8 | toReplaceBy
| ) |  |

Returns true when any replacement was done.

## ◆ replaceChars16() [1/2]

bool replaceChars16 | ( | const char16 * | toReplace,
|  | char16 | toReplaceBy
| ) |  |

## ◆ replaceChars8() [2/2]

bool replaceChars8 | ( | char8 | toReplace,
|  | char8 | toReplaceBy
| ) |  |
| inline

## ◆ replaceChars16() [2/2]

bool replaceChars16 | ( | char16 | toReplace,
|  | char16 | toReplaceBy
| ) |  |
| inline

## ◆ replaceChars() [1/4]

bool replaceChars | ( | char8 | toReplace,
|  | char8 | toReplaceBy
| ) |  |
| inline

## ◆ replaceChars() [2/4]

bool replaceChars | ( | char16 | toReplace,
|  | char16 | toReplaceBy
| ) |  |
| inline

## ◆ replaceChars() [3/4]

bool replaceChars | ( | const char8 * | toReplace,
|  | char8 | toReplaceBy
| ) |  |
| inline

## ◆ replaceChars() [4/4]

bool replaceChars | ( | const char16 * | toReplace,
|  | char16 | toReplaceBy
| ) |  |
| inline

## ◆ remove()

String & remove | ( | uint32 | index = `0`,
|  | int32 | n = `-1`
| ) |  |

Remove n characters from string starting at index (n=-1: until end)

## ◆ trim()

bool trim | ( | String::CharGroup | group = `kSpace` | ) |

Trim lead/trail.

## ◆ removeChars() [1/5]

void removeChars | ( | CharGroup | mode = `kSpace` | ) |

Removes all of group.

## ◆ removeChars8() [1/2]

bool removeChars8 | ( | const char8 * | which | ) |

Remove all occurrences of each char in 'which'.

## ◆ removeChars16() [1/2]

bool removeChars16 | ( | const char16 * | which | ) |

Remove all occurrences of each char in 'which'.

## ◆ removeChars8() [2/2]

bool removeChars8 | ( | const char8 | which | ) |
| inline

## ◆ removeChars16() [2/2]

bool removeChars16 | ( | const char16 | which | ) |
| inline

## ◆ removeChars() [2/5]

bool removeChars | ( | const char8 * | which | ) |
| inline

## ◆ removeChars() [3/5]

bool removeChars | ( | const char16 * | which | ) |
| inline

## ◆ removeChars() [4/5]

bool removeChars | ( | const char8 | which | ) |
| inline

## ◆ removeChars() [5/5]

bool removeChars | ( | const char16 | which | ) |
| inline

## ◆ removeSubString()

bool removeSubString | ( | const ConstString & | subString,
|  | bool | allOccurences = `true`
| ) |  |

## ◆ printf() [1/2]

String & printf | ( | const char8 * | format,
|  |  | ...
| ) |  |

Print formatted data into string.

## ◆ printf() [2/2]

String & printf | ( | const char16 * | format,
|  |  | ...
| ) |  |

Print formatted data into string.

## ◆ vprintf() [1/2]

String & vprintf | ( | const char8 * | format,
|  | va_list | args
| ) |  |

## ◆ vprintf() [2/2]

String & vprintf | ( | const char16 * | format,
|  | va_list | args
| ) |  |

## ◆ printInt64()

String & printInt64 | ( | int64 | value | ) |

## ◆ printFloat()

String & printFloat | ( | double | value,
|  | uint32 | maxPrecision = `6`
| ) |  |

print a float into a string, trailing zeros will be trimmed

Parameters

  value | the floating value to be printed
  maxPrecision | (optional) the max precision allowed for this, num of significant digits after the comma For instance printFloat (1.234, 2) => 1.23

Returns
  the resulting string.

## ◆ incrementTrailingNumber()

bool incrementTrailingNumber | ( | uint32 | width = `2`,
|  | char | separator = `STR (' ')`,
|  | uint32 | minNumber = `1`,
|  | bool | applyOnlyFormat = `false`
| ) |  |

Increment the trailing number if present else start with minNumber, width specifies the string width format (width 2 for number 3 is 03), applyOnlyFormat set to true will only format the string to the given width without incrementing the founded trailing number.

## ◆ fromVariant()

bool fromVariant | ( | const FVariant & | var | ) |

Assigns string from FVariant.

## ◆ toVariant()

void toVariant | ( | FVariant & | var | ) | const

## ◆ fromAttributes()

bool fromAttributes | ( | IAttributes * | a,
|  | IAttrID | attrID
| ) |  |

Assigns string from FAttributes.

## ◆ toAttributes()

bool toAttributes | ( | IAttributes * | a,
|  | IAttrID | attrID
| ) |  |

## ◆ swapContent()

void swapContent | ( | String & | s | ) |

Swaps ownership of the strings pointed to.

## ◆ take() [1/2]

void take | ( | String & | str | ) |

Take ownership of the string of 'str'.

## ◆ take() [2/2]

void take | ( | void * | _buffer,
|  | bool | wide
| ) |  |

Take ownership of buffer.

## ◆ pass()

void * pass | ( |  | ) |

## ◆ passToVariant()

void passToVariant | ( | FVariant & | var | ) |

Pass ownership of buffer to Variant - sets Variant ownership.

## ◆ toLower() [1/2]

void toLower | ( | uint32 | index | ) |

Lower case the character.

## ◆ toLower() [2/2]

void toLower | ( |  | ) |

Lower case the string.

## ◆ toUpper() [1/2]

void toUpper | ( | uint32 | index | ) |

Upper case the character.

## ◆ toUpper() [2/2]

void toUpper | ( |  | ) |

Upper case the string.

## ◆ toPascalString()

unsigned char * toPascalString | ( | unsigned char * | buf | ) |

Pascal string conversion.

## ◆ fromPascalString()

const String & fromPascalString | ( | const unsigned char * | buf | ) |

Pascal string conversion.

## ◆ toWideString()

bool toWideString | ( | uint32 | sourceCodePage = `kCP_Default` | ) |

Converts to wide string according to sourceCodePage.

## ◆ toMultiByte()

bool toMultiByte | ( | uint32 | destCodePage = `kCP_Default` | ) |

## ◆ fromUTF8()

void fromUTF8 | ( | const char8 * | utf8String | ) |

Assigns from UTF8 string.

## ◆ normalize()

bool normalize | ( | UnicodeNormalization | n = `kUnicodeNormC` | ) |

On PC only kUnicodeNormC is working.

## ◆ resize()

bool resize | ( | uint32 | newSize,
|  | bool | wide,
|  | bool | fill = `false`
| ) |  |
| protected

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.