General string class. More...
#include <mi32/mistring.h>

Public Types | |
| enum | ENCODING { ENCODING_URI = 0, ENCODING_XML = 1, ENCODING_HTML = 2 } |
| enum | FLOATFMT { FLOATFMT_General = 0, FLOATFMT_Fixed = 1, FLOATFMT_Scientific = 2, FLOATFMT_MaxPrecision = 3 } |
| enum | LINETERM { LINETERM_LF = 0, LINETERM_CR = 1, LINETERM_CRLF = 2 } |
Public Member Functions | |
| MISTRING (double value) | |
| MISTRING (UINT64 value) | |
| MISTRING (unsigned long value) | |
| MISTRING (unsigned int value) | |
| MISTRING (INT64 value) | |
| MISTRING (long value) | |
| MISTRING (int value) | |
| MISTRING (const void *str, CHAR_ENCODING encoding) | |
| MISTRING (TEXTID textid) | |
| MISTRING (const STRUTF8 &rhs) | |
| MISTRING (const char *str) | |
| MISTRING (const MIUNICODE *ustr) | |
| MISTRING (const MISTRING &rhs) | |
| MISTRING () | |
| ~MISTRING () | |
| void | Append (const MISTRING &str, int start=0, int end=INT32_MAX) |
| void | Assign (const void *str, CHAR_ENCODING encoding) |
| void | Assign (const char *str, CHAR_ENCODING encoding) |
| void | Assign (const char *str, int len) |
| void | Assign (const MIUNICODE *str, int start=0, int end=INT32_MAX) |
| void | Assign (const MISTRING &str, int start=0, int end=INT32_MAX) |
| void | AssignFromSizeAbbr (INT64 size) |
| bool | CheckLineTermination (LINETERM lineterm) const |
| void | Clear () |
| int | Compare (int SrcStart, const STRUTF8 &str, int OtherStart, int len) const |
| int | Compare (const STRUTF8 &str, int len) const |
| int | Compare (const STRUTF8 &str) const |
| int | Compare (int SrcStart, const char *str, int OtherStart, int len) const |
| int | Compare (const char *str, int len) const |
| int | Compare (const char *str) const |
| int | Compare (int SrcStart, const MISTRING &str, int OtherStart, int len) const |
| int | Compare (const MISTRING &str, int len) const |
| int | Compare (const MISTRING &str) const |
| int | CompareNatural (const MISTRING &str) const |
| int | CompareNoCase (int SrcStart, const STRUTF8 &str, int OtherStart, int len) const |
| int | CompareNoCase (const STRUTF8 &str, int len) const |
| int | CompareNoCase (const STRUTF8 &str) const |
| int | CompareNoCase (int SrcStart, const char *str, int OtherStart, int len) const |
| int | CompareNoCase (const char *str, int len) const |
| int | CompareNoCase (const char *str) const |
| int | CompareNoCase (int SrcStart, const MISTRING &str, int OtherStart, int len) const |
| int | CompareNoCase (const MISTRING &str, int len) const |
| int | CompareNoCase (const MISTRING &str) const |
| MISTRING & | ConvertFrom (ENCODING Encoding) |
| MISTRING & | ConvertTo (ENCODING Encoding) |
| double | ConvertToDouble () const |
| int | FindAndReplace (const char *search, const char *replace, bool all, int start=0) |
| int | FindAndReplace (const char *search, const MISTRING &replace, bool all, int start=0) |
| int | FindAndReplace (const MISTRING &search, const MISTRING &replace, bool all, int start=0) |
| int | FindNextAfter (const char *str, int start=0) const |
| int | FindNextAfter (const MISTRING &str, int start=0) const |
| int | FindNextInSet (const MISTRING &chars, int start=0) const |
| int | FindNextNotInSet (const MISTRING &chars, int start=0) const |
| int | FindNextOf (const char *str, int start=0) const |
| int | FindNextOf (const MISTRING &str, int start=0) const |
| int | FindNextOf (MIUNICODE c, int start=0) const |
| int | FindPrevInSet (const MISTRING &chars, int start=INT32_MAX) const |
| int | FindPrevNotInSet (const MISTRING &chars, int start=INT32_MAX) const |
| int | FindPrevOf (MIUNICODE c, int start=INT32_MAX) const |
| void | FmtEnableSubstitution (bool enable=true) |
| void | FmtSetBase (int base) |
| void | FmtSetFill (MIUNICODE fill) |
| void | FmtSetFloat (FLOATFMT floatmode) |
| void | FmtSetPrecision (int precision) |
| void | FmtSetSign (bool sign) |
| void | FmtSetThousandSeparator (char c) |
| void | FmtSetWidth (int width) |
| void * | GetEncoded (CHAR_ENCODING encoding) const |
| int | GetLength () const |
| const MIUNICODE * | GetReference () const |
| MIUNICODE * | GetString () const |
| MISTRING | GetSubString (int start, int end) const |
| MISTRING | GetSubString (int start) const |
| bool | IniRead (INIHANDLE handle, const char *group, const char *field) |
| bool | IniReadML (INIHANDLE handle, const char *group, const char *field) |
| void | IniWrite (INIHANDLE handle, const char *group, const char *field) const |
| void | IniWriteML (INIHANDLE handle, const char *group, const char *field) const |
| void | Insert (int start, const MISTRING &str, int strstart=0, int strend=INT32_MAX) |
| bool | IsEmpty () const |
| bool | IsLike (const MISTRING &pattern, bool bIgnoreCase=false, MIUNICODE WildCard= '%', MIUNICODE SingleMatchChar= '_', MIUNICODE EscapeChar= '\\') const |
| void | Join (const MISTRINGLIST &list, const char *sep="") |
| void | Join (const MISTRINGLIST &list, const MIUNICODE *sep) |
| void | MakeExclusive () |
| operator const MIUNICODE * () const | |
| MISTRING & | operator+= (MIUNICODE c) |
| MISTRING & | operator+= (const char *rhs) |
| MISTRING & | operator+= (const MIUNICODE *rhs) |
| MISTRING & | operator+= (const MISTRING &rhs) |
| MISTRING & | operator<< (TEXTID textid) |
| MISTRING & | operator<< (const MISTRING &s) |
| MISTRING & | operator<< (const STRUTF8 &s) |
| MISTRING & | operator<< (const MIUNICODE *s) |
| MISTRING & | operator<< (const char *s) |
| MISTRING & | operator<< (double f) |
| MISTRING & | operator<< (float f) |
| MISTRING & | operator<< (UINT64 n) |
| MISTRING & | operator<< (unsigned long n) |
| MISTRING & | operator<< (unsigned int n) |
| MISTRING & | operator<< (unsigned short n) |
| MISTRING & | operator<< (INT64 n) |
| MISTRING & | operator<< (long n) |
| MISTRING & | operator<< (int n) |
| MISTRING & | operator<< (short n) |
| MISTRING & | operator<< (unsigned char n) |
| MISTRING & | operator<< (signed char n) |
| MISTRING & | operator<< (char c) |
| MISTRING & | operator<< (bool b) |
| MISTRING & | operator<< (STR_OP op) |
| MISTRING & | operator= (const char *rhs) |
| MISTRING & | operator= (const MIUNICODE *rhs) |
| MISTRING & | operator= (TEXTID textid) |
| MISTRING & | operator= (const STRUTF8 &rhs) |
| MISTRING & | operator= (const MISTRING &rhs) |
| const MIUNICODE & | operator[] (int idx) const |
| void | Pad (MIUNICODE c, int numchars) |
| void | PadToLength (MIUNICODE c, int length) |
| void | Remove (int start, int end) |
| void | Replace (int start, int end, const char *str) |
| void | Replace (int start, int end, const MISTRING &str, int strstart=0, int strend=INT32_MAX) |
| void | Replace (int index, MIUNICODE c) |
| ERRVALUE | Reserve (int numchars) |
| bool | Search (const UCREGEXP ®ex, UINT32 &MatchStart, UINT32 &MatchEnd, UINT32 Start=0) const |
| bool | Search (const MIUNICODE *str, UINT32 &MatchStart, UINT32 &MatchEnd, bool bIgnoreCase=false, UINT32 Start=0) const |
| bool | SetLineTermination (LINETERM lineterm) |
| void | SetLowerCase (int start=0) |
| void | SetUpperCase (int start=0) |
| int | Split (const MIUNICODE *regexp, MISTRINGLIST &list, int maxitems=0) const |
| int | Split (MIUNICODE ch, MISTRINGLIST &list, int maxitems=0) const |
| void | Terminate (MIUNICODE c) |
| void | Truncate (int length) |
| void | WordWrap (int MaxLineLength) |
Static Public Member Functions | |
| static const MISTRING & | GetEmpty () |
General string class.
Supports internationalization, Unicode and various character set encodings.
MISTRING supports use of '<<' to 'put' values into the string similar to iostream. When using '<<' the current MISTRING is first searched for a formatting code or a substitution placeholder. Formatting codes in the form d, s, f, etc. are searched for first. The first code compatible with the value being put into the string will be used. Thus, if a number is being put then any d, u, f, etc code will be used. These formatting codes can also specify the width and precision if desired. Thus, '%.8f' may be used to specify 8 decimal places of precision. These settings only apply to the current value being put into the string. If no width, precision, etc is specified then any previously set formatting state settings will apply. If no -style formatting code is found then a search is made for substitution placeholders in the form $1, $2, etc. The lowest numbered placeholder will be replaced with the value being put into the string. Finally, if no placeholder is found then the value being put will be appended to the end of the string.
| enum MISTRING::ENCODING |
| ENCODING_URI |
Encoding to use URI non-reserved characters. |
| ENCODING_XML |
Encoding to use XML non-reserved characters. |
| ENCODING_HTML |
Encoding to use HTML, convert from MicroImages test style formatting codes. |
| enum MISTRING::FLOATFMT |
| enum MISTRING::LINETERM |
| MISTRING::MISTRING | ( | ) |
Default constructor.
| MISTRING::MISTRING | ( | const MISTRING & | rhs | ) |
Copy constructor.
| MISTRING::MISTRING | ( | const MIUNICODE * | ustr | ) |
Construct from MIUNICODE* string (implicit).
| MISTRING::MISTRING | ( | const char * | str | ) | [explicit] |
Construct from char* string.
| MISTRING::MISTRING | ( | TEXTID | textid | ) |
Construct from TEXTID (implicit).
| textid | Messsage text ID |
| MISTRING::MISTRING | ( | const void * | str, | |
| CHAR_ENCODING | encoding | |||
| ) |
Construct from string in specified encoding.
| MISTRING::MISTRING | ( | int | value | ) | [explicit] |
Construct from INT32 (int) with default formatting.
| MISTRING::MISTRING | ( | long | value | ) | [explicit] |
Construct from (long) with default formatting.
| MISTRING::MISTRING | ( | INT64 | value | ) | [explicit] |
Construct from INT64 with default formatting.
| MISTRING::MISTRING | ( | unsigned int | value | ) | [explicit] |
Construct from UINT32 (unsigned int) with default formatting.
| MISTRING::MISTRING | ( | unsigned long | value | ) | [explicit] |
Construct from (unsigned long) with default formatting.
| MISTRING::MISTRING | ( | UINT64 | value | ) | [explicit] |
Construct from UINT64 with default formatting.
| MISTRING::MISTRING | ( | double | value | ) | [explicit] |
Construct from floating-point with default formatting.
| MISTRING::~MISTRING | ( | ) |
Append from MISTRING.
| str | String to append | |
| start | Starting position in 'str' to append to this string | |
| end | Ending position in 'str' to append to this string |
| void MISTRING::Assign | ( | const void * | str, | |
| CHAR_ENCODING | encoding | |||
| ) |
Assign from string in specified encoding.
| str | Buffer holding appropriately-terminated string | |
| encoding | Encoding of string |
| void MISTRING::Assign | ( | const char * | str, | |
| CHAR_ENCODING | encoding | |||
| ) | [inline] |
Assign from string in specified encoding.
| str | Buffer holding appropriately-terminated string | |
| encoding | Encoding of string |
| void MISTRING::Assign | ( | const char * | str, | |
| int | len | |||
| ) |
Assign from ASCII char* string with length limit.
| str | String to assign from | |
| len | Length limit |
Assign from MIUNICODE string.
| str | Buffer holding MIUNICODE string | |
| start | Starting position in 'str' to assign to this string | |
| end | Ending position in 'str' to assign to this string |
| void MISTRING::AssignFromSizeAbbr | ( | INT64 | size | ) |
Assign to string from 'size' Will append KB, MB, GB, .
.. depending on the value of 'size'
| size | Size to generate abbreviated form from |
| bool MISTRING::CheckLineTermination | ( | LINETERM | lineterm | ) | const |
Determine if string consistently uses specified line termination.
| lineterm | Line termination |
| void MISTRING::Clear | ( | ) |
Clear the string.
| int MISTRING::Compare | ( | int | SrcStart, | |
| const STRUTF8 & | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::Compare | ( | const STRUTF8 & | str, | |
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::Compare | ( | const STRUTF8 & | str | ) | const |
Case-sensitive comparison (similar to strcmp).
| str | String to compare to |
| int MISTRING::Compare | ( | int | SrcStart, | |
| const char * | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::Compare | ( | const char * | str, | |
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::Compare | ( | const char * | str | ) | const |
Case-sensitive comparison (similar to strcmp).
| str | String to compare to |
| int MISTRING::Compare | ( | int | SrcStart, | |
| const MISTRING & | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::Compare | ( | const MISTRING & | str, | |
| int | len | |||
| ) | const |
Case-sensitive comparison, length limited (similar to strncmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::Compare | ( | const MISTRING & | str | ) | const |
Case-sensitive comparison (similar to strcmp).
| str | String to compare to |
| int MISTRING::CompareNatural | ( | const MISTRING & | str | ) | const |
Natural comparison, parses proper integer and decimal numbers interleave with alphabetic and symbolic groups.
Alphabetic portions are compared using "nocase".
| int MISTRING::CompareNoCase | ( | int | SrcStart, | |
| const STRUTF8 & | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::CompareNoCase | ( | const STRUTF8 & | str, | |
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::CompareNoCase | ( | const STRUTF8 & | str | ) | const |
Case-insensitive comparison (similar to stricmp).
| str | String to compare to |
| int MISTRING::CompareNoCase | ( | int | SrcStart, | |
| const char * | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::CompareNoCase | ( | const char * | str, | |
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::CompareNoCase | ( | const char * | str | ) | const |
Case-insensitive comparison (similar to stricmp).
| str | String to compare to |
| int MISTRING::CompareNoCase | ( | int | SrcStart, | |
| const MISTRING & | str, | |||
| int | OtherStart, | |||
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| SrcStart | Start position of 'this' string | |
| str | String to compare to | |
| OtherStart | Start position of 'str' | |
| len | Maximum number of characters to compare, -1 to compare to end of 'str' |
| int MISTRING::CompareNoCase | ( | const MISTRING & | str, | |
| int | len | |||
| ) | const |
Case-insensitive comparison, length limited (similar to strnicmp).
| str | String to compare to | |
| len | Maximum number of characters to compare, -1 to use length of comparison string |
| int MISTRING::CompareNoCase | ( | const MISTRING & | str | ) | const |
Case-insensitive comparison (similar to stricmp).
| str | String to compare to |
Convert from an encoding specified by 'Encoding' parameter The will replace encoded characters in-place with reserved replacements Eg: for XML '&' would be replaced with '&'.
For HTML '20' will be replaced with 'space'
Convert to an encoding specified by 'Encoding' parameter The will replace reserved characters in-place with known replacements Eg: for XML '&' would be replaced with '&'.
For HTML 'space' will be replaced with '20' WARNING: To convert to URI or XML, the conversion must occur in pieces, not the whole thing
| double MISTRING::ConvertToDouble | ( | ) | const |
Convert string to double-precision numeric value.
| int MISTRING::FindAndReplace | ( | const char * | search, | |
| const char * | replace, | |||
| bool | all, | |||
| int | start = 0 | |||
| ) |
Find and replace one or all occurrences of one string with another.
| search | String to search for | |
| replace | String to replace with (may be NULL or empty) | |
| all | True to process all occurrences, false to replace first occurrance only | |
| start | Starting position, default is start of string. |
| int MISTRING::FindAndReplace | ( | const char * | search, | |
| const MISTRING & | replace, | |||
| bool | all, | |||
| int | start = 0 | |||
| ) |
Find and replace one or all occurrences of one string with another.
| search | String to search for | |
| replace | String to replace with (may be empty) | |
| all | True to process all occurrences, false to replace first occurrance only | |
| start | Starting position, default is start of string. |
| int MISTRING::FindAndReplace | ( | const MISTRING & | search, | |
| const MISTRING & | replace, | |||
| bool | all, | |||
| int | start = 0 | |||
| ) |
Find and replace one or all occurrences of one string with another.
| search | String to search for | |
| replace | String to replace with (may be empty) | |
| all | True to process all occurrences, false to replace first occurrance only | |
| start | Starting position, default is start of string. |
| int MISTRING::FindNextAfter | ( | const char * | str, | |
| int | start = 0 | |||
| ) | const |
Find next position after given char* string.
| str | String to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextAfter | ( | const MISTRING & | str, | |
| int | start = 0 | |||
| ) | const |
Find next position after given string.
| str | String to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextInSet | ( | const MISTRING & | chars, | |
| int | start = 0 | |||
| ) | const |
Find next occurrence in given set of characters (similar to strpbrk).
| chars | Characters to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextNotInSet | ( | const MISTRING & | chars, | |
| int | start = 0 | |||
| ) | const |
Find next occurrence not in given set of characters.
| chars | Characters to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextOf | ( | const char * | str, | |
| int | start = 0 | |||
| ) | const |
Find next occurrence of given char* string.
| str | String to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextOf | ( | const MISTRING & | str, | |
| int | start = 0 | |||
| ) | const |
Find next occurrence of given string.
| str | String to search for | |
| start | Starting position, default is start of string |
| int MISTRING::FindNextOf | ( | MIUNICODE | c, | |
| int | start = 0 | |||
| ) | const |
Find next occurrence of given character.
| c | Character to search for | |
| start | Starting position, default is start of string |
Find previous occurrence in given set of characters.
| chars | Characters to search for | |
| start | Starting position, default is end of string |
Find previous occurrence not in given set of characters.
| chars | Characters to search for | |
| start | Starting position, default is end of string |
Find previous occurrence of given character (similar to strrchr).
| c | Character to search for | |
| start | Starting position, default is end of string |
| void MISTRING::FmtEnableSubstitution | ( | bool | enable = true |
) |
Enable substitution during formatting.
Initial default is enabled.
| enable | 'true' to enable, 'false' to disable |
| void MISTRING::FmtSetBase | ( | int | base | ) |
Set integer base.
| base | Integer base 2-36 |
| void MISTRING::FmtSetFill | ( | MIUNICODE | fill | ) |
Set fill character for padding.
| fill | Fill character |
| void MISTRING::FmtSetFloat | ( | FLOATFMT | floatmode | ) |
Set floating point formatting mode.
| floatmode | Floating point formatting mode |
| void MISTRING::FmtSetPrecision | ( | int | precision | ) |
Set precision (number of decimal places) for floating-point output.
| precision | Floating-point precision |
| void MISTRING::FmtSetSign | ( | bool | sign | ) |
Set whether to shown sign for positive numbers.
Sign is only shown if integer base is 10.
| sign | True to show sign, false to not |
| void MISTRING::FmtSetThousandSeparator | ( | char | c | ) |
Set character for "thousand" separator.
Default separator is comma (,).
| c | Character to use for separator |
| void MISTRING::FmtSetWidth | ( | int | width | ) |
Set minimum width for next formatted value.
Note that at width setting only applies to one value after which time it will reset to 0 (minimum).
| width | Minimum width |
| static const MISTRING& MISTRING::GetEmpty | ( | ) | [static] |
Get reference to empty string.
| void* MISTRING::GetEncoded | ( | CHAR_ENCODING | encoding | ) | const |
Get string in specified encoding.
| encoding | Encoding |
| int MISTRING::GetLength | ( | ) | const |
Get length in characters.
| const MIUNICODE* MISTRING::GetReference | ( | ) | const |
Get string reference.
Used to avoid static_cast<const MIUNICODE*>(MISTRING).
| MIUNICODE* MISTRING::GetString | ( | ) | const |
Get allocated string.
| MISTRING MISTRING::GetSubString | ( | int | start, | |
| int | end | |||
| ) | const |
Retrieve sub-string.
| start | Starting position | |
| end | Ending position (inclusive) |
| MISTRING MISTRING::GetSubString | ( | int | start | ) | const |
Retrieve sub-string.
| start | Starting position |
| bool MISTRING::IniRead | ( | INIHANDLE | handle, | |
| const char * | group, | |||
| const char * | field | |||
| ) |
Read string from .ini file.
| handle | Ini Handle created by IniOpen() | |
| group | Group to look for ini entry, App Name if =0 | |
| field | Field to read string from |
| bool MISTRING::IniReadML | ( | INIHANDLE | handle, | |
| const char * | group, | |||
| const char * | field | |||
| ) |
Read multi-line string from .ini file.
| handle | Ini Handle created by IniOpen() | |
| group | Group to look for ini entry, App Name if =0 | |
| field | Field to read string from |
| void MISTRING::IniWrite | ( | INIHANDLE | handle, | |
| const char * | group, | |||
| const char * | field | |||
| ) | const |
Write string to .ini file.
| handle | Ini Handle created by IniOpen() | |
| group | Group to write ini entry, App Name if =0 | |
| field | Field to write string to |
| void MISTRING::IniWriteML | ( | INIHANDLE | handle, | |
| const char * | group, | |||
| const char * | field | |||
| ) | const |
Write multi-line string to .ini file.
| handle | Ini Handle created by IniOpen() | |
| group | Group to write ini entry, App Name if =0 | |
| field | Field to write string to |
Insert all or part of another string at specified position.
| start | Position to insert before | |
| str | String to insert | |
| strstart | Start of replace string | |
| strend | End of replace string |
| bool MISTRING::IsEmpty | ( | ) | const |
Determine if string is empty.
| bool MISTRING::IsLike | ( | const MISTRING & | pattern, | |
| bool | bIgnoreCase = false, |
|||
| MIUNICODE | WildCard = '%', |
|||
| MIUNICODE | SingleMatchChar = '_', |
|||
| MIUNICODE | EscapeChar = '\\' | |||
| ) | const |
Determine if one string is "like" another using.
This method uses the SQL definition of "like". The pattern string can contain a "%" character as a wildcard matching any number of characters (0 or more) and a "_" as a wildcard matching one character. To specify a % or _ itself, you have to preceed it with a "\" Note, you can override the default wildcard and escape characters.
| void MISTRING::Join | ( | const MISTRINGLIST & | list, | |
| const char * | sep = "" | |||
| ) |
Join all the strings in an MISTRINGLIST into one string The char* variant of this function exists because most often, you want to join the strings together with simple whitespace or commas.
| void MISTRING::Join | ( | const MISTRINGLIST & | list, | |
| const MIUNICODE * | sep | |||
| ) |
Join all the strings in an MISTRINGLIST into one string.
| void MISTRING::MakeExclusive | ( | ) |
MISTRING's strings are shared, reference counted entities.
Sometimes it is desirable to ensure that a MISTRING's string is exclusive to it. Eg: Transferring MISTRINGs between threads.
| MISTRING::operator const MIUNICODE * | ( | ) | const |
Cast to (const MIUNICODE *).
Cast to non-const is not supported as destruction cannot be enforced for temporaries. Cast to UINT8* or char* is not permitted as encoding cannot be specified.
| MISTRING& MISTRING::operator+= | ( | const char * | rhs | ) |
Concatenation from char* (ASCII/ISO-Latin1).
| MISTRING& MISTRING::operator<< | ( | const char * | s | ) |
Format and put ASCII string into string.
| MISTRING& MISTRING::operator<< | ( | double | f | ) |
Format and put (double) value into string.
| MISTRING& MISTRING::operator<< | ( | float | f | ) |
Format and put (float) value into string.
| MISTRING& MISTRING::operator<< | ( | unsigned long | n | ) |
Format and put (unsigned long) value into string.
| MISTRING& MISTRING::operator<< | ( | unsigned int | n | ) |
Format and put UINT32 (unsigned int) value into string.
| MISTRING& MISTRING::operator<< | ( | unsigned short | n | ) |
Format and put UINT16 (unsigned short) value into string.
Warning, use of MIUNICODE will result in numeric value being put into string.
| MISTRING& MISTRING::operator<< | ( | long | n | ) |
Format and put (long) value into string.
| MISTRING& MISTRING::operator<< | ( | int | n | ) |
Format and put INT32 (int) value into string.
| MISTRING& MISTRING::operator<< | ( | short | n | ) |
Format and put INT16 (short) value into string.
| MISTRING& MISTRING::operator<< | ( | unsigned char | n | ) |
Format and put UINT8 (unsigned char) numeric value into string.
| MISTRING& MISTRING::operator<< | ( | signed char | n | ) |
Format and put INT8 (signed char) numeric value into string.
| MISTRING& MISTRING::operator<< | ( | char | c | ) |
Format and put single character into string.
| MISTRING& MISTRING::operator<< | ( | bool | b | ) |
Format and put 'bool' value into string.
| MISTRING& MISTRING::operator= | ( | const char * | rhs | ) |
Assignment from char* (ASCII/ISO-Latin1).
Systems where wchar_t is not same as UINT16(MIUNICODE)
| const MIUNICODE& MISTRING::operator[] | ( | int | idx | ) | const |
Read array element.
| void MISTRING::Pad | ( | MIUNICODE | c, | |
| int | numchars | |||
| ) |
Pad with specified character.
| c | Character to pad with | |
| numchars | Number of characters to pad |
| void MISTRING::PadToLength | ( | MIUNICODE | c, | |
| int | length | |||
| ) |
Pad with specified character to given length.
| c | Character to pad with | |
| length | Length to pad to |
| void MISTRING::Remove | ( | int | start, | |
| int | end | |||
| ) |
Remove a section of the string.
| start | Starting index to remove sub-string | |
| end | Ending index to remove sub-string |
| void MISTRING::Replace | ( | int | start, | |
| int | end, | |||
| const char * | str | |||
| ) |
Replace a section of a string with a char* string.
| start | Start of string section to replace | |
| end | End of string section to replace | |
| str | String to replace with |
| void MISTRING::Replace | ( | int | start, | |
| int | end, | |||
| const MISTRING & | str, | |||
| int | strstart = 0, |
|||
| int | strend = INT32_MAX | |||
| ) |
Replace a section of a string with another sub-string.
| start | Start of string section to replace | |
| end | End of string section to replace | |
| str | String to replace with | |
| strstart | Start of replace string | |
| strend | End of replace string |
| void MISTRING::Replace | ( | int | index, | |
| MIUNICODE | c | |||
| ) |
Replace single character at specified position.
This cannot be used to truncate or extend the string, attempts to do so will be ignored.
| index | Index from start of string, must be from 0 to GetLength()-1 | |
| c | Character value to replace with, will ignore if 0 |
| ERRVALUE MISTRING::Reserve | ( | int | numchars | ) |
Reserve enough memory for specified number of characters.
| numchars | Number of characters |
| bool MISTRING::Search | ( | const UCREGEXP & | regex, | |
| UINT32 & | MatchStart, | |||
| UINT32 & | MatchEnd, | |||
| UINT32 | Start = 0 | |||
| ) | const |
Search for a regular expression.
Returns true if the given regular expression could be found, false if not. MatchStart/MatchEnd values returned are only meaningful if a match was found.
Note, this version doesn't have the bIgnoreCase parameter because that is specified when you create the UCREGEXP that you pass in.
For details of RE syntax, see mi32/ucregexp.h or the documentation for the class UCREGEXP.
| regex | Regular expression to search for | |
| MatchStart | Start of match RETURNED | |
| MatchEnd | End of match RETURNED | |
| Start | Where to start in source string |
| bool MISTRING::Search | ( | const MIUNICODE * | str, | |
| UINT32 & | MatchStart, | |||
| UINT32 & | MatchEnd, | |||
| bool | bIgnoreCase = false, |
|||
| UINT32 | Start = 0 | |||
| ) | const |
Search for a regular expression.
Returns true if the given regular expression could be found, false if not. MatchStart/MatchEnd values returned are only meaningful if a match was found.
If you plan to search multiple strings for the same expression, it's more effecient to use the version of Search that takes a reference to a UCREGEXP.
Note: If the string to search for is just a simple string, you're better off calling FindNextOf() instead.
For details of RE syntax, see mi32/ucregexp.h or the documentation for the class UCREGEXP.
| str | Regular expression to search for | |
| MatchStart | Start of match RETURNED | |
| MatchEnd | End of match RETURNED | |
| bIgnoreCase | Ignore case if true | |
| Start | Where to start in source string |
| bool MISTRING::SetLineTermination | ( | LINETERM | lineterm | ) |
Set string to use specified line termination.
Note, this does not affect future additions to the string.
| lineterm | Line termination |
| void MISTRING::SetLowerCase | ( | int | start = 0 |
) |
Set all characters to lowercase.
| start | Starting position to lowercase string |
| void MISTRING::SetUpperCase | ( | int | start = 0 |
) |
Set all characters to uppercase.
| start | Starting position to uppercase string |
| int MISTRING::Split | ( | const MIUNICODE * | regexp, | |
| MISTRINGLIST & | list, | |||
| int | maxitems = 0 | |||
| ) | const |
Split a string up into a list of strings.
| regexp | Regular Expression to match delimiters | |
| list | The list of strings returned | |
| maxitems | The maximum number of items to split out. If 0 (the default), it will split all items. |
| int MISTRING::Split | ( | MIUNICODE | ch, | |
| MISTRINGLIST & | list, | |||
| int | maxitems = 0 | |||
| ) | const |
Split a string up into a list of strings.
| ch | Delimiter | |
| list | The list of strings returned | |
| maxitems | The maximum number of items to split out. If 0 (the default), it will split all items. |
| void MISTRING::Terminate | ( | MIUNICODE | c | ) |
Terminate with specified character if not already the last.
Typically used to terminate with newline.
| c | Character to terminate |
| void MISTRING::Truncate | ( | int | length | ) |
Truncate to specified number of characters.
| length | Length to truncate to |
| void MISTRING::WordWrap | ( | int | MaxLineLength | ) |
Word-wrap the string based on number of characters per line.
| MaxLineLength | Maximum line length in characters |
1.6.1