![]() |
Murl Engine API
Version 2018.3
|
String manipulation and test functions. More...
Modules | |
String conversion Functions | |
String conversion functions. | |
String name/path Functions | |
String manipulation and test functions. | |
Functions | |
const String & | Murl::Util::StaticEmptyString () |
Get the reference to a static empty string. More... | |
const String & | Murl::Util::StaticWhitespaceString () |
Get the reference to a static whitespace string. More... | |
const StringArray & | Murl::Util::StaticEmptyStringArray () |
Get the reference to a static empty string array. More... | |
String | Murl::Util::PrintToString (const Char *format,...) |
Print formatted variadic arguments into string. More... | |
UInt32 | Murl::Util::SplitString (const String &inputString, Char delimiter, StringArray &pieces, Bool acceptEmpty=false) |
Split a string into pieces using a given delimiter, the pieces are stored in a string array. More... | |
UInt32 | Murl::Util::SplitString (const String &inputString, Char delimiter, StringIndex &pieces, Bool acceptEmpty=false) |
Split a string into pieces using a given delimiter, the pieces are stored in a string index. More... | |
UInt32 | Murl::Util::SplitString (const String &inputString, const String &delimiters, StringArray &pieces, Bool acceptEmpty=false) |
Split a string into pieces using a given set of delimiters, the pieces are stored in a string array. More... | |
UInt32 | Murl::Util::SplitString (const String &inputString, const String &delimiters, StringIndex &pieces, Bool acceptEmpty=false) |
Split a string into pieces using a given set of delimiters, the pieces are stored in a string index. More... | |
String | Murl::Util::JoinStringArray (const StringArray &inputStrings, const String &separator, Bool joinEmpty=false) |
Join all strings from a string array. More... | |
String | Murl::Util::JoinStringIndex (const StringIndex &inputStrings, const String &separator, Bool joinEmpty=false) |
Join all strings from a string index. More... | |
String | Murl::Util::IndentString (const String &inputString, SInt32 indent, Bool indentEmpty=false) |
Indent a (multi-line) string by a given number of white spaces. More... | |
String | Murl::Util::FillInParameters (const String &inputString, const StringArray ¶meters) |
Fill in a set of given parameters into a placeholder string. More... | |
void | Murl::Util::TrimStringArray (StringArray &inputString) |
Trim all strings in a string array. More... | |
String | Murl::Util::GetLine (const String &inputString, SInt32 &startPos) |
Get a line from a string. More... | |
String | Murl::Util::GetWord (const String &inputString, SInt32 &startPos) |
Get the next word from a string. More... | |
Bool | Murl::Util::HasCppScope (const String &className) |
Check if a class name has a "::" part. More... | |
String | Murl::Util::GetCppScope (const String &className) |
Get the class name substring before the "::" part. More... | |
String | Murl::Util::StripCppScope (const String &className) |
Get the class name substring behind the "::" part. More... | |
Bool | Murl::Util::HasScope (const String &name) |
Check if a name has a dot character. More... | |
String | Murl::Util::GetScope (const String &name) |
Get the substring before the dot character. More... | |
String | Murl::Util::StripScope (const String &name) |
Get the substring behind the dot character. More... | |
Bool | Murl::Util::StripIndex (String &name, UInt32 &index, Bool trimOutput=true) |
Strip the index part from a name and get the index value. More... | |
Bool | Murl::Util::StripCount (String &name, UInt32 &count, Bool trimOutput=true) |
Strip the count part from a name and get its value. More... | |
Bool | Murl::Util::IsIdValid (const String &identifier) |
Check if an identifier string is valid. More... | |
Bool | Murl::Util::IsNumeric (const String &str) |
Check if a string has numeric characters only. More... | |
Bool | Murl::Util::IsAlphaNumeric (const String &str) |
Check if a string has alphanumeric characters only. More... | |
Bool | Murl::Util::IsDigit (Char chr) |
Check if a character is a digit character. More... | |
Bool | Murl::Util::IsAlpha (Char chr) |
Check if a character is an alphabetic character. More... | |
Bool | Murl::Util::IsAlphaNumeric (Char chr) |
Check if a character is an alphanumeric character. More... | |
Bool | Murl::Util::IsPunctuation (Char chr) |
Check if a character is a punctuation character. More... | |
Bool | Murl::Util::IsSpace (Char chr) |
Check if a character is a spacing character. More... | |
Bool | Murl::Util::IsHexDigit (Char chr) |
Check if a character is a hexadecimal character. More... | |
Bool | Murl::Util::IsControl (Char chr) |
Check if a character is a control character. More... | |
String manipulation and test functions.
const String& Murl::Util::StaticEmptyString | ( | ) |
Get the reference to a static empty string.
const String& Murl::Util::StaticWhitespaceString | ( | ) |
Get the reference to a static whitespace string.
The whitespace string contains the characters:
const StringArray& Murl::Util::StaticEmptyStringArray | ( | ) |
Get the reference to a static empty string array.
Print formatted variadic arguments into string.
format | The format string. |
... | The variadic arguments. |
UInt32 Murl::Util::SplitString | ( | const String & | inputString, |
Char | delimiter, | ||
StringArray & | pieces, | ||
Bool | acceptEmpty = false |
||
) |
Split a string into pieces using a given delimiter, the pieces are stored in a string array.
inputString | The string to split. |
delimiter | The delimiter character. |
pieces | The pieces return value. |
acceptEmpty | If true, also empty pieces are accepted, i.e. subsequent pieces are considered to be separated by a single delimiter only. |
UInt32 Murl::Util::SplitString | ( | const String & | inputString, |
Char | delimiter, | ||
StringIndex & | pieces, | ||
Bool | acceptEmpty = false |
||
) |
Split a string into pieces using a given delimiter, the pieces are stored in a string index.
inputString | The string to split. |
delimiter | The delimiter character. |
pieces | The pieces return value. |
acceptEmpty | If true, also empty pieces are accepted, i.e. subsequent pieces are considered to be separated by a single delimiter only. |
UInt32 Murl::Util::SplitString | ( | const String & | inputString, |
const String & | delimiters, | ||
StringArray & | pieces, | ||
Bool | acceptEmpty = false |
||
) |
Split a string into pieces using a given set of delimiters, the pieces are stored in a string array.
inputString | The string to split. |
delimiters | A string containing all delimiter characters. |
pieces | The pieces return value. |
acceptEmpty | If true, also empty pieces are accepted, i.e. subsequent pieces are considered to be separated by a single delimiter only. |
UInt32 Murl::Util::SplitString | ( | const String & | inputString, |
const String & | delimiters, | ||
StringIndex & | pieces, | ||
Bool | acceptEmpty = false |
||
) |
Split a string into pieces using a given set of delimiters, the pieces are stored in a string index.
inputString | The string to split. |
delimiters | A string containing all delimiter characters. |
pieces | The pieces return value. |
acceptEmpty | If true, also empty pieces are accepted, i.e. subsequent pieces are considered to be separated by a single delimiter only. |
String Murl::Util::JoinStringArray | ( | const StringArray & | inputStrings, |
const String & | separator, | ||
Bool | joinEmpty = false |
||
) |
Join all strings from a string array.
inputStrings | The string array to join. |
separator | The separator string to separate the input strings. |
joinEmpty | If true, also empty strings are added from the input strings. |
String Murl::Util::JoinStringIndex | ( | const StringIndex & | inputStrings, |
const String & | separator, | ||
Bool | joinEmpty = false |
||
) |
Join all strings from a string index.
inputStrings | The string index to join. |
separator | The separator string to separate the input strings. |
joinEmpty | If true, also empty strings are added from the input strings. |
String Murl::Util::IndentString | ( | const String & | inputString, |
SInt32 | indent, | ||
Bool | indentEmpty = false |
||
) |
Indent a (multi-line) string by a given number of white spaces.
inputString | The string to indent. |
indent | The number of spaces to indent. If this is negative, the given number of spaces are removed from the beginning of each line, if present. |
indentEmpty | If false, empty lines are not processed (default). |
String Murl::Util::FillInParameters | ( | const String & | inputString, |
const StringArray & | parameters | ||
) |
Fill in a set of given parameters into a placeholder string.
A placeholder is represented by a zero-based integer within curly braces, e.g. "{0}", "{7}" or "{42}" (without quotes). The integer represents the index into the given parameters array.
inputString | The placeholder string. |
parameters | An array of string holding the individual parameters. |
void Murl::Util::TrimStringArray | ( | StringArray & | inputString | ) |
Trim all strings in a string array.
Trim white spaces from left and right for each string in the array.
inputString | The string array to trim. |
Get a line from a string.
inputString | The string to get the line from. |
startPos | The start position to get the line from. The start position is set to the beginning of the next line or to -1 if the end of the input string is reached. |
Get the next word from a string.
inputString | The string to get the word from. |
startPos | The start position to get the word from. The start position is set to the beginning of the next word or to -1 if the end of the input string is reached. |
Check if a class name has a "::" part.
className | The class name string. |
Get the class name substring before the "::" part.
className | The class name string. |
Get the class name substring behind the "::" part.
className | The class name string. |
Check if a name has a dot character.
name | The name string. |
Get the substring before the dot character.
name | The name string. |
Get the substring behind the dot character.
name | The name string. |
Strip the index part from a name and get the index value.
For example, the input string "param[7]" will be split so that the "name" variable contains the string "param", and index is set to 7.
name | The name string to strip. |
index | The index return value. |
trimOutput | If true, leading and trailing whitespaces are removed from the name after stripping. |
Strip the count part from a name and get its value.
For example, the input string "param7" will be split so that the "name" variable contains the string "param", and count is set to 7.
name | The name string to strip. |
count | The count return value. |
trimOutput | If true, leading and trailing whitespaces are removed from the name after stripping. |
Check if an identifier string is valid.
A valid identifer contains:
identifier | The identifer string to check. |
Check if a string has numeric characters only.
A leading '+' or '-' character is allowed.
str | The string to check. |
Check if a string has alphanumeric characters only.
str | The string to check. |
Check if a character is a digit character.
chr | The character to check. |
Check if a character is an alphabetic character.
chr | The character to check. |
Check if a character is an alphanumeric character.
chr | The character to check. |
Check if a character is a punctuation character.
chr | The character to check. |
Check if a character is a spacing character.
A whitespace is a space, form feed '\f', newline '\n', carriage return '\r', vertical tabulator '\v' or horizontal tabulator '\t' character.
chr | The character to check. |
Check if a character is a hexadecimal character.
chr | The character to check. |