MISTRING Class Reference

General string class. More...

#include <mi32/mistring.h>

Inheritance diagram for MISTRING:
Inheritance graph
[legend]

List of all members.

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
MISTRINGConvertFrom (ENCODING Encoding)
MISTRINGConvertTo (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 MIUNICODEGetReference () const
MIUNICODEGetString () 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
MISTRINGoperator+= (MIUNICODE c)
MISTRINGoperator+= (const char *rhs)
MISTRINGoperator+= (const MIUNICODE *rhs)
MISTRINGoperator+= (const MISTRING &rhs)
MISTRINGoperator<< (TEXTID textid)
MISTRINGoperator<< (const MISTRING &s)
MISTRINGoperator<< (const STRUTF8 &s)
MISTRINGoperator<< (const MIUNICODE *s)
MISTRINGoperator<< (const char *s)
MISTRINGoperator<< (double f)
MISTRINGoperator<< (float f)
MISTRINGoperator<< (UINT64 n)
MISTRINGoperator<< (unsigned long n)
MISTRINGoperator<< (unsigned int n)
MISTRINGoperator<< (unsigned short n)
MISTRINGoperator<< (INT64 n)
MISTRINGoperator<< (long n)
MISTRINGoperator<< (int n)
MISTRINGoperator<< (short n)
MISTRINGoperator<< (unsigned char n)
MISTRINGoperator<< (signed char n)
MISTRINGoperator<< (char c)
MISTRINGoperator<< (bool b)
MISTRINGoperator<< (STR_OP op)
MISTRINGoperator= (const char *rhs)
MISTRINGoperator= (const MIUNICODE *rhs)
MISTRINGoperator= (TEXTID textid)
MISTRINGoperator= (const STRUTF8 &rhs)
MISTRINGoperator= (const MISTRING &rhs)
const MIUNICODEoperator[] (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 &regex, 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 MISTRINGGetEmpty ()

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
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.

Enumerator:
FLOATFMT_General 

General (equivalent to "%G").

FLOATFMT_Fixed 

Fixed (equivalent to "%f").

FLOATFMT_Scientific 

Scientific (equivalent to "%E").

FLOATFMT_MaxPrecision 

Retain maximum precision in in minimum space (ignores Separator, Strip, Prec settings).

Enumerator:
LINETERM_LF 

Terminate lines with '\n'.

LINETERM_CR 

Terminate lines with '\r'.

LINETERM_CRLF 

Terminate lines with '\r\n'.


Constructor & Destructor Documentation

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 ( const STRUTF8 rhs  ) 

Construct from STRUTF8 string (implicit).

MISTRING::MISTRING ( TEXTID  textid  ) 

Construct from TEXTID (implicit).

Parameters:
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 (  ) 

Member Function Documentation

void MISTRING::Append ( const MISTRING str,
int  start = 0,
int  end = INT32_MAX 
)

Append from MISTRING.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
str String to assign from
len Length limit
void MISTRING::Assign ( const MIUNICODE str,
int  start = 0,
int  end = INT32_MAX 
)

Assign from MIUNICODE string.

Parameters:
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::Assign ( const MISTRING str,
int  start = 0,
int  end = INT32_MAX 
)

Assign from MISTRING.

Parameters:
str Buffer holding MISTRING
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'

Parameters:
size Size to generate abbreviated form from
bool MISTRING::CheckLineTermination ( LINETERM  lineterm  )  const

Determine if string consistently uses specified line termination.

Returns:
true if specified termination used, false if not.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str.
Parameters:
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".

Returns:
0 if strings equal, -1 if this < str, 1 if this > str.
int MISTRING::CompareNoCase ( int  SrcStart,
const STRUTF8 str,
int  OtherStart,
int  len 
) const

Case-insensitive comparison, length limited (similar to strnicmp).

Returns:
0 if equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This version exists to resolve an ambiguity and force the comparison in the Unicode domain.
Parameters:
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).

Returns:
0 if equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str. This should only be used to compare to a string literal.
Parameters:
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).

Returns:
0 if equal, -1 if this < str, 1 if this > str.
Parameters:
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).

Returns:
0 if equal, -1 if this < str, 1 if this > str.
Parameters:
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).

Returns:
0 if strings equal, -1 if this < str, 1 if this > str.
Parameters:
str String to compare to
MISTRING& MISTRING::ConvertFrom ( ENCODING  Encoding  ) 

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'

Returns:
: 'this' to facilitate use in '<<' operations
MISTRING& MISTRING::ConvertTo ( ENCODING  Encoding  ) 

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

Returns:
: 'this' to facilitate use in '<<' operations
double MISTRING::ConvertToDouble (  )  const

Convert string to double-precision numeric value.

Returns:
Converted value or 0.0 if unable to convert.
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.

Returns:
If 'all' is false, position after replaced string or -1 if not found, otherwise number of replacements made.
Parameters:
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.

Returns:
If 'all' is false, position after replaced string or -1 if not found, otherwise number of replacements made.
Parameters:
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.

Returns:
If 'all' is false, position after replaced string or -1 if not found, otherwise number of replacements made.
Parameters:
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.

Returns:
Next position after substring or -1 if not found.
Parameters:
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.

Returns:
Next position after substring or -1 if not found.
Parameters:
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).

Returns:
Character position or -1 if not found.
Parameters:
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.

Returns:
Character position or -1 if not found.
Parameters:
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.

Returns:
Starting position of substring or -1 if not found.
Parameters:
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.

Returns:
Starting position of substring or -1 if not found.
Parameters:
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.

Returns:
Position of character or -1 if not found.
Parameters:
c Character to search for
start Starting position, default is start of string
int MISTRING::FindPrevInSet ( const MISTRING chars,
int  start = INT32_MAX 
) const

Find previous occurrence in given set of characters.

Returns:
Position or -1 if not found.
Parameters:
chars Characters to search for
start Starting position, default is end of string
int MISTRING::FindPrevNotInSet ( const MISTRING chars,
int  start = INT32_MAX 
) const

Find previous occurrence not in given set of characters.

Returns:
Position or -1 if not found.
Parameters:
chars Characters to search for
start Starting position, default is end of string
int MISTRING::FindPrevOf ( MIUNICODE  c,
int  start = INT32_MAX 
) const

Find previous occurrence of given character (similar to strrchr).

Returns:
Position of character or -1 if not found.
Parameters:
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.

Parameters:
enable 'true' to enable, 'false' to disable
void MISTRING::FmtSetBase ( int  base  ) 

Set integer base.

Parameters:
base Integer base 2-36
void MISTRING::FmtSetFill ( MIUNICODE  fill  ) 

Set fill character for padding.

Parameters:
fill Fill character
void MISTRING::FmtSetFloat ( FLOATFMT  floatmode  ) 

Set floating point formatting mode.

Parameters:
floatmode Floating point formatting mode
void MISTRING::FmtSetPrecision ( int  precision  ) 

Set precision (number of decimal places) for floating-point output.

Parameters:
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.

Parameters:
sign True to show sign, false to not
void MISTRING::FmtSetThousandSeparator ( char  c  ) 

Set character for "thousand" separator.

Default separator is comma (,).

Parameters:
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).

Parameters:
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.

Returns:
Encoded string caller must free.
Parameters:
encoding Encoding
int MISTRING::GetLength (  )  const

Get length in characters.

Returns:
Length in characters.
const MIUNICODE* MISTRING::GetReference (  )  const

Get string reference.

Used to avoid static_cast<const MIUNICODE*>(MISTRING).

Returns:
Pointer to internal string, do not free!
MIUNICODE* MISTRING::GetString (  )  const

Get allocated string.

Returns:
Pointer to string, caller must free
MISTRING MISTRING::GetSubString ( int  start,
int  end 
) const

Retrieve sub-string.

Returns:
Substring from position up to specified length.
Parameters:
start Starting position
end Ending position (inclusive)
MISTRING MISTRING::GetSubString ( int  start  )  const

Retrieve sub-string.

Returns:
Substring from position to end of string.
Parameters:
start Starting position
bool MISTRING::IniRead ( INIHANDLE  handle,
const char *  group,
const char *  field 
)

Read string from .ini file.

Returns:
true if entry in file, false if not
Parameters:
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.

Returns:
true if entry in file, false if not
Parameters:
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.

Parameters:
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.

Parameters:
handle Ini Handle created by IniOpen()
group Group to write ini entry, App Name if =0
field Field to write string to
void MISTRING::Insert ( int  start,
const MISTRING str,
int  strstart = 0,
int  strend = INT32_MAX 
)

Insert all or part of another string at specified position.

Parameters:
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.

Returns:
true if string is empty, false if not.
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+= ( MIUNICODE  c  ) 

Append single character (Unicode or ASCII).

MISTRING& MISTRING::operator+= ( const char *  rhs  ) 

Concatenation from char* (ASCII/ISO-Latin1).

MISTRING& MISTRING::operator+= ( const MIUNICODE rhs  ) 

Concatenation from MIUNICODE* string.

MISTRING& MISTRING::operator+= ( const MISTRING rhs  ) 

Concatenation from MISTRING.

MISTRING& MISTRING::operator<< ( TEXTID  textid  ) 

Format and text from TEXTID put into string.

MISTRING& MISTRING::operator<< ( const MISTRING s  ) 

Format and put MISTRING into string.

MISTRING& MISTRING::operator<< ( const STRUTF8 s  ) 

Format and put STRUTF8 string into string.

MISTRING& MISTRING::operator<< ( const MIUNICODE s  ) 

Format and put MIUNICODE string into string.

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<< ( UINT64  n  ) 

Format and put (UINT64) 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<< ( INT64  n  ) 

Format and put (INT64) value 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<< ( STR_OP  op  ) 

Perform operation on string.

MISTRING& MISTRING::operator= ( const char *  rhs  ) 

Assignment from char* (ASCII/ISO-Latin1).

Systems where wchar_t is not same as UINT16(MIUNICODE)

MISTRING& MISTRING::operator= ( const MIUNICODE rhs  ) 

Assignment from MIUNICODE* string.

MISTRING& MISTRING::operator= ( TEXTID  textid  ) 

Assignment from TEXTID.

MISTRING& MISTRING::operator= ( const STRUTF8 rhs  ) 

Assignment from STRUTF8.

MISTRING& MISTRING::operator= ( const MISTRING rhs  ) 

Assignment from MISTRING.

const MIUNICODE& MISTRING::operator[] ( int  idx  )  const

Read array element.

void MISTRING::Pad ( MIUNICODE  c,
int  numchars 
)

Pad with specified character.

Parameters:
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.

Parameters:
c Character to pad with
length Length to pad to
void MISTRING::Remove ( int  start,
int  end 
)

Remove a section of the string.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:
true if string changed, false if not.
Parameters:
lineterm Line termination
void MISTRING::SetLowerCase ( int  start = 0  ) 

Set all characters to lowercase.

Parameters:
start Starting position to lowercase string
void MISTRING::SetUpperCase ( int  start = 0  ) 

Set all characters to uppercase.

Parameters:
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.

Parameters:
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.
Returns:
number of strings in list
int MISTRING::Split ( MIUNICODE  ch,
MISTRINGLIST list,
int  maxitems = 0 
) const

Split a string up into a list of strings.

Parameters:
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.
Returns:
number of strings in list
void MISTRING::Terminate ( MIUNICODE  c  ) 

Terminate with specified character if not already the last.

Typically used to terminate with newline.

Parameters:
c Character to terminate
void MISTRING::Truncate ( int  length  ) 

Truncate to specified number of characters.

Parameters:
length Length to truncate to
void MISTRING::WordWrap ( int  MaxLineLength  ) 

Word-wrap the string based on number of characters per line.

Parameters:
MaxLineLength Maximum line length in characters

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

Generated on Sun Oct 7 21:33:40 2012 for TNTsdk 2012 by  doxygen 1.6.1