simba_wstring Class Reference

Portable Unicode string. More...

List of all members.

Classes

class  CaseInsensitiveComparator
 Class for doing case-insensitive comparisons of simba_wstring in a map. More...

Public Member Functions

simba_int32 Char32At (simba_int32 in_index) const
 Return the code point that contains the code unit at offset.
wchar_t CharAt (simba_int32 in_index) const
 (Deprecated) Gets the character at the given index.
void Clear ()
 Sets the simba_wstring to a "null" value.
wchar_t CodeUnitAt (simba_int32 in_index) const
 Gets a code unit at the given offset index.
simba_int32 Compare (const simba_wstring &in_string, simba_int32 in_offset, simba_int32 in_length) const
 Performs a comparison of the given string to the current string.
simba_int32 Compare (const simba_wstring &in_string, simba_int32 in_length, bool in_isCaseSensitive) const
 Performs a comparison of the given string to the current string.
simba_int32 Compare (const simba_wstring &in_string, simba_int32 in_length) const
 Performs a comparison of the given string to the current string.
simba_int32 Compare (const simba_wstring &in_string, bool in_isCaseSensitive=true) const
 Performs a comparison of the given string to the current string.
simba_int32 Find (const simba_wstring &in_subStr, simba_int32 in_startPos=0) const
 Finds the position within the string where in_subStr is located.
simba_int32 FindFirstNotOf (const simba_wstring &in_tokens, simba_int32 in_startPos=0) const
 Find the first character in the source string that isn't one of the given tokens.
simba_int32 FindLast (const simba_wstring &in_subStr, simba_int32 in_startPos=0) const
 Finds the last position within the string where in_subStr is located.
std::string GetAsAnsiString (EncodingType in_encoding) const
 Returns an std::string version of the string, which has the encoding matching the given input encoding. The input encoding must be a narrow encoding (eg every code unit should be one byte).
std::string GetAsPlatformString () const
 Returns an std::string version of the string, which has the encoding GetAppCharEncoding().
std::wstring GetAsPlatformWString () const
 Returns an std::wstring version of the string, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
simba_string GetAsUTF8 () const
 Retrieves a UTF8 version of the string, stored in a simba_string.
simba_int32 GetBufferLength () const
 Get the current length/capacity of the underlying string buffer.
const simba_byteGetConstBuffer () const
 Gets a read only buffer for the underlying string data.
simba_int32 GetLength () const
 Returns the number of code units in the string. Returns 0 if the string is "null".
simba_int32 GetLengthInBytes () const
 Gets the length of the string in bytes.
simba_int32 GetLengthInCodePoints () const
 Returns the number of code points in the string. Returns 0 if the string is "null".
simba_byteGetWritableBuffer ()
 Gets a writable buffer for the underlying string data. Call GetBufferLength() to get the length of buffer returned by this call.
simba_byteGetWritableBuffer (simba_int32 in_length)
 Gets a writable buffer for the underlying string data of a specified minimum size.
void Insert (simba_int32 in_start, const simba_wstring &in_string)
 Insert text into string at the offset (codeunit).
bool IsAlpha (simba_int32 in_index) const
 Determines whether the given character is a letter.
bool IsAlphaNumeric (simba_int32 in_index) const
 Determines whether the given character is letter or a digit.
bool IsDigit (simba_int32 in_index) const
 Determines whether the character at the given index is a digit.
bool IsEmpty () const
 Determine if the string is empty.
bool IsEqual (const simba_wstring &in_string, bool in_isCaseSensitive=true) const
 Performs a comparison of the given string to the current string, with optional case sensitivity.
bool IsNull () const
 Indicates if the string is considered "NULL".
bool IsWhitespace (simba_int32 in_index) const
 Determines whether the character at the given index is whitespace.
template<typename Iter >
simba_wstring Join (Iter in_first, Iter in_end) const
 Join a range of simba_wstrings using this string as a separator.
simba_wstringLTrim ()
 Left trims blank space and tab characters of the string in place.
simba_int32 MoveIndex32 (simba_int32 in_index, simba_int32 in_delta)
 Return the code unit index after moving n code points.
bool operator!= (const simba_wstring &in_rhs) const
 Is Not Equal operator.
simba_wstring operator+ (const simba_wstring &in_rhs) const
 Plus operator.
simba_wstringoperator+= (const simba_wstring &in_rhs)
 Plus Equal (append) operator.
bool operator< (const simba_wstring &in_rhs) const
 Less Than operator. "null" strings are considered less than any strings which aren't "null".
simba_wstringoperator= (const std::wstring &in_str)
 Assignment operator with NUL-terminated std::wstring input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
simba_wstringoperator= (const simba_string &in_str)
 Assignment operator with NUL-terminated simba_string input, which has the encoding GetAnsiCharEncoding().
simba_wstringoperator= (const wchar_t *in_str)
 Assignment operator with NUL-terminated wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
simba_wstringoperator= (const simba_char *in_str)
 Assignment operator with NUL-terminated simba_char* input, which has the encoding GetAnsiCharEncoding().
simba_wstringoperator= (const simba_wstring &in_wstr)
 Assignment operator.
bool operator== (const simba_wstring &in_rhs) const
 Is Equal operator.
bool PadTrailing (simba_int32 in_length, wchar_t in_char)
 Pads the end of this string with the given character up until the given length.
simba_wstringRegexReplace (const simba_wstring &in_regexPattern, const simba_wstring &in_newValue, simba_uint32 in_flags=0)
 Replaces all instances of in_regexPattern with in_newValue via regular expressions.
void ReleaseWritableBuffer (simba_int32 in_newLength=SIMBA_NTS)
 Releases a writable buffer.
void Remove (simba_int32 start_pos, simba_int32 length)
 Removes a range of characters (code Units) from the string starting at the start_pos.
simba_wstring Repeat (simba_size_t in_repeatCount) const
 Create a string that is this string repeated N times.
void Replace (const simba_int32 in_offset, const simba_int32 in_length, wchar_t in_srcChar)
 Replaces a set of instances with a new value at a particular index (code unit).
simba_wstringReplace (const simba_wstring &in_oldValue, const simba_wstring &in_newValue)
 Replaces all instances of in_oldValue with in_newValue.
simba_wstringRTrim ()
 Right trims blank space and tab characters of the string in place.
void SetFromUTF8 (const void *in_str, simba_int32 in_length)
 Sets the simba_wstring value from a UTF-8 encoded buffer.
void SetFromUTF8 (const simba_string &in_str)
 Set the simba_wstring value from a UTF-8 string.
simba_wstringShrinkToNullChar (simba_int32 in_startPos=0)
 Truncate the string if it contains a ''.
 simba_wstring (SqlData &in_data)
 Constructor with SqlData input.
 simba_wstring (const wchar_t *in_str, simba_int32 in_length)
 Constructor with wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
 simba_wstring (const wchar_t *in_str)
 Constructor with NUL-terminated wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
 simba_wstring (const simba_byte *in_str, simba_int32 in_length, EncodingType in_encType)
 Constructor with simba_byte* input, which has the encoding in_encType.
 simba_wstring (const simba_byte *in_str, simba_int32 in_length)
 Constructor with simba_byte* input, which has the encoding of GetDatabaseWCharEncoding().
 simba_wstring (const simba_char *in_str, simba_int32 in_length)
 Constructor with simba_char* input, which has the encoding GetAnsiCharEncoding().
 simba_wstring (const simba_char *in_str)
 Constructor with NUL-terminated simba_char* input, which has the encoding GetAnsiCharEncoding().
 simba_wstring (simba_char in_char, simba_int32 in_count)
 Constructor to create a simba_wstring filled with a repeating character.
 simba_wstring (const std::wstring &in_str)
 Constructor with std::wstring input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.
 simba_wstring (const simba_string &in_str)
 simba_wstring (const simba_wstring &in_str)
 Copy Constructor.
 simba_wstring ()
 Default constructor.
bool StartsWith (const simba_wstring &in_prefix) const
 Checks whether this string has a prefix of in_prefix.
simba_wstring Substr (simba_int32 in_start, simba_int32 in_len) const
 Returns a substring of maximum length in_len code units, starting at the code unit in_start.
simba_wstring Substr (simba_int32 in_start) const
 Returns a substring of maximum length code units, starting at the code unit in_start.
void Swap (simba_wstring &io_otherString) throw ()
 Swap the contents of this string with io_otherString. This method is faster than using the copy constructor or assignment operator.
simba_wstring Tokenize (simba_int32 &io_pos, const simba_wstring &in_delimiter) const
 Tokenize the given string based on the input delimiters.
simba_wstringToLower ()
 Converts the string to an lower case string in place.
simba_wstringToUpper ()
 Converts the string to an upper case string in place.
simba_wstringTrim ()
 Trims the string in place.
 ~simba_wstring ()
 Destructor.

Static Public Member Functions

static simba_wstring CreateFromUTF8 (const void *in_str, simba_int32 in_length)
 Creates a simba_wstring from a UTF-8 encoded buffer.
static simba_wstring CreateFromUTF8 (const simba_string &in_str)
 Creates a simba_wstring from a UTF-8 encoded simba_string.
char *strings return The ANSI
character encoding *static
EncodingType 
GetAppCharEncoding ()
 Retrieves the encoding used by the application for SQLCHAR.
static EncodingType GetDatabaseCharEncoding ()
 Retrieves the encoding used by the DataBase for SQLCHAR* strings.
static EncodingType GetDatabaseWCharEncoding ()
 Retrieves the encoding used by the DataBase for SQLWCHAR* strings.
static EncodingType GetDriverManagerEncoding ()
 Retrieves the encoding used by the DriverManager for SQLWCHAR* strings.
static const simba_charGetEncodingName (EncodingType in_encType)
 Get the ICU defined encoding name for the input encoding type.
static EncodingType GetInternalEncoding ()
static void InitializeAppCharEncoding ()
 Sets the encoding used by the standard library function string arguments. This uses the current Locale's encoding as determined by ICU.
template<typename Iter >
static simba_wstring Join (Iter in_first, Iter in_end, const simba_wstring &in_separator)
 Join a range of simba_wstrings using the given separator.
static void SetDatabaseCharEncoding (EncodingType in_encType)
 Sets the encoding used by the Database for SQLCHAR* strings.
static void SetDatabaseWCharEncoding (EncodingType in_encType)
 Sets the encoding used by the Database for SQLWCHAR* strings.
static void SetDriverManagerEncoding (EncodingType in_encType)
 Sets the encoding used by the DriverManager for SQLWCHAR* strings.
static size_t WideCharStringLength (const wchar_t *in_wideCharString, size_t in_numberOfElements)
 Used for measuring wchar strings' length in code units. Replaces non-standard function wcsnlen when encoding used is not the same as the standard library (system default) encoding for wide char literals.
static size_t WideCharStringLength (const wchar_t *in_wideCharString)
 Used for measuring wchar strings' length in code units. Replaces wcslen when encoding used is not the same as the standard library (system default) encoding for wide char literals.

Static Public Attributes

static const simba_uint32 SIMBA_REGEX_CASE_INSENSITIVE
 Flag indicating that the regex should use case insensitive matching.
static const simba_uint32 SIMBA_REGEX_COMMENTS
 Flag indicating that whitespace and comments can be used in patterns.
static const simba_uint32 SIMBA_REGEX_DOTALL
 Flag indicating that a '.' matches a line terminator..
static const simba_uint32 SIMBA_REGEX_MULTILINE
 Flag indicating that '^' and '$' characters match the start and end of every line in the input.
static const simba_uint32 SIMBA_REGEX_REPLACE_FIRST_ONLY
 Flag indicating only the first match will be replaced.

Friends

class ODBCStringConverter
class TimestampTzConverter
class WideStringConverter

Detailed Description

Portable Unicode string.


Constructor & Destructor Documentation

simba_wstring (  ) 

Default constructor.

Creates a "null" simba_wstring.

simba_wstring ( const simba_wstring in_str  ) 

Copy Constructor.

Parameters:
in_str The other object to copy from.
simba_wstring ( const simba_string in_str  ) 

Constructor with simba_string input, which has the encoding GetAnsiCharEncoding().

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLCHAR* OR UTF-8 SOURCE DATA! SQLCHAR* MAY NOT NECESSARILY USE THE SAME ENCODING AS simba_char*! UTF-8 MAY NOT TOO!

Parameters:
in_str A string.
simba_wstring ( const std::wstring &  in_str  ) 

Constructor with std::wstring input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLWCHAR* SOURCE DATA! SQLWCHAR AND WCHAR_T DO NOT NECESSARILY USE THE SAME ENCODING!

Parameters:
in_str 
simba_wstring ( simba_char  in_char,
simba_int32  in_count 
)

Constructor to create a simba_wstring filled with a repeating character.

Parameters:
in_char The character to fill the simba_wstring with.
in_count The number of times to repeat in_char.
simba_wstring ( const simba_char in_str  ) 

Constructor with NUL-terminated simba_char* input, which has the encoding GetAnsiCharEncoding().

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLCHAR* OR UTF-8 SOURCE DATA! SQLCHAR* MAY NOT NECESSARILY USE THE SAME ENCODING AS simba_char*! UTF-8 MAY NOT TOO!

Parameters:
in_str A string.
simba_wstring ( const simba_char in_str,
simba_int32  in_length 
)

Constructor with simba_char* input, which has the encoding GetAnsiCharEncoding().

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLCHAR* OR UTF-8 SOURCE DATA! SQLCHAR* MAY NOT NECESSARILY USE THE SAME ENCODING AS simba_char*! UTF-8 MAY NOT TOO!

Parameters:
in_str 
in_length Count of simba_chars in in_str, or SIMBA_NTS to indicate that in_str is NUL-terminated.
simba_wstring ( const simba_byte in_str,
simba_int32  in_length 
)

Constructor with simba_byte* input, which has the encoding of GetDatabaseWCharEncoding().

Parameters:
in_str The string data in binary format.
in_length Count of simba_bytes in in_data.
simba_wstring ( const simba_byte in_str,
simba_int32  in_length,
EncodingType  in_encType 
)

Constructor with simba_byte* input, which has the encoding in_encType.

Parameters:
in_str The string data in binary format.
in_length Count of simba_bytes in in_data.
in_encType The encoding type the byte data is in.
simba_wstring ( const wchar_t *  in_str  ) 

Constructor with NUL-terminated wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLWCHAR* SOURCE DATA! SQLWCHAR AND WCHAR_T DO NOT NECESSARILY USE THE SAME ENCODING!

Parameters:
in_str 
simba_wstring ( const wchar_t *  in_str,
simba_int32  in_length 
)

Constructor with wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLWCHAR* SOURCE DATA! SQLWCHAR AND WCHAR_T DO NOT NECESSARILY USE THE SAME ENCODING!

Parameters:
in_str 
in_length Count of wchar_t elements in in_str
simba_wstring ( SqlData in_data  ) 

Constructor with SqlData input.

Parameters:
in_data The data to construct the string from. Must be of character type. Constructs a null string if it contains NULL data.
~simba_wstring (  ) 

Destructor.


Member Function Documentation

simba_int32 Char32At ( simba_int32  in_index  )  const

Return the code point that contains the code unit at offset.

Parameters:
in_index The offset in code units.
Returns:
the character which contains the code unit at the given index. If offset is invalid, returns U+FFFF (65535)
wchar_t CharAt ( simba_int32  in_index  )  const

(Deprecated) Gets the character at the given index.

Parameters:
in_index The index (0-based) of the character to get.
Deprecated:
Since 9.5: NOTE: This function has the potential of returning erroneous information. Currently it returns the code point of the string and down casts it to wchar_t.
Returns:
the character at the given index.
void Clear (  ) 

Sets the simba_wstring to a "null" value.

wchar_t CodeUnitAt ( simba_int32  in_index  )  const

Gets a code unit at the given offset index.

Parameters:
in_index The offset (code units) from which to retrieve a single code unit.
Returns:
the code unit at the given code unit index.
simba_int32 Compare ( const simba_wstring in_string,
simba_int32  in_offset,
simba_int32  in_length 
) const

Performs a comparison of the given string to the current string.

Parameters:
in_string The string to compare against, in its entirety.
in_offset The offset in code units to compare against.
in_length The length of string in code units to compare.
Returns:
0 if the strings are equal, -1 if this is less than the given string, +1 otherwise.
simba_int32 Compare ( const simba_wstring in_string,
simba_int32  in_length,
bool  in_isCaseSensitive 
) const

Performs a comparison of the given string to the current string.

Parameters:
in_string The string to compare against this string.
in_length The length of string to compare.
in_isCaseSensitive True if taking case into account, false otherwise.
Returns:
0 if the strings are equal, -1 if this is less than the given string, +1 otherwise.
simba_int32 Compare ( const simba_wstring in_string,
simba_int32  in_length 
) const

Performs a comparison of the given string to the current string.

Parameters:
in_string The string to compare against this string.
in_length The length of string to compare.
Returns:
0 if the strings are equal, -1 if this is less than the given string, +1 otherwise.
simba_int32 Compare ( const simba_wstring in_string,
bool  in_isCaseSensitive = true 
) const

Performs a comparison of the given string to the current string.

Parameters:
in_string The string to compare against this string.
in_isCaseSensitive True if taking case into account, false otherwise.
Returns:
0 if the strings are equal, -1 if this is less than the given string, +1 otherwise.
static simba_wstring CreateFromUTF8 ( const void *  in_str,
simba_int32  in_length 
) [inline, static]

Creates a simba_wstring from a UTF-8 encoded buffer.

Parameters:
in_str The UTF-8 encoded buffer to build a simba_wstring from. (NOT OWN)
in_length Count of simba_chars in in_str, or SIMBA_NTS to indicate that in_str is NUL-terminated.
Returns:
A new simba_string.
static simba_wstring CreateFromUTF8 ( const simba_string in_str  )  [inline, static]

Creates a simba_wstring from a UTF-8 encoded simba_string.

Parameters:
in_str The UTF-8 encoded string to build a simba_wstring from.
Returns:
A new simba_string.
simba_int32 Find ( const simba_wstring in_subStr,
simba_int32  in_startPos = 0 
) const

Finds the position within the string where in_subStr is located.

Parameters:
in_subStr The substring to search within the string.
in_startPos The code unit index in the string to start searching from.
Returns:
The position found, or SIMBA_NPOS if not found or one of the strings is "null".
simba_int32 FindFirstNotOf ( const simba_wstring in_tokens,
simba_int32  in_startPos = 0 
) const

Find the first character in the source string that isn't one of the given tokens.

Parameters:
in_tokens The string containing the token characters.
in_startPos The code unit index in the string to start searching from.
Returns:
The index of the first character not in the token string, or SIMBA_NPOS if no non-token characters are found or one of the strings is "null".
simba_int32 FindLast ( const simba_wstring in_subStr,
simba_int32  in_startPos = 0 
) const

Finds the last position within the string where in_subStr is located.

Parameters:
in_subStr The substring to search within the string.
in_startPos The code unit index in the string to start searching from.
Returns:
The position found, or SIMBA_NPOS if not found or one of the strings is "null".
char* strings return The ANSI character encoding* static EncodingType GetAppCharEncoding (  )  [inline, static]

Retrieves the encoding used by the application for SQLCHAR.

std::string GetAsAnsiString ( EncodingType  in_encoding  )  const

Returns an std::string version of the string, which has the encoding matching the given input encoding. The input encoding must be a narrow encoding (eg every code unit should be one byte).

Parameters:
in_encoding The encoding of the output std::string.
Returns:
The std::string version of the string, encoded in in_encoding's encoding.
std::string GetAsPlatformString (  )  const [inline]

Returns an std::string version of the string, which has the encoding GetAppCharEncoding().

Returns:
The std::string version of the string, encoded in GetAppCharEncoding().
std::wstring GetAsPlatformWString (  )  const

Returns an std::wstring version of the string, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

Returns:
The std::wstring version of the string, encoded in SIMBA_PLATFORM_WCHAR_ENCODING.
simba_string GetAsUTF8 (  )  const [inline]

Retrieves a UTF8 version of the string, stored in a simba_string.

Returns:
The simba_string version of the string, encoded in UTF-8.
simba_int32 GetBufferLength (  )  const

Get the current length/capacity of the underlying string buffer.

const simba_byte* GetConstBuffer (  )  const

Gets a read only buffer for the underlying string data.

Returns NULL if there is no underlying WideStringImpl allocated.

Returns:
Read only buffer for the underlying string data. (NOT OWN)
static EncodingType GetDatabaseCharEncoding (  )  [inline, static]

Retrieves the encoding used by the DataBase for SQLCHAR* strings.

Returns:
The SQLCHAR encoding of the database.
static EncodingType GetDatabaseWCharEncoding (  )  [inline, static]

Retrieves the encoding used by the DataBase for SQLWCHAR* strings.

Returns:
The SQLWCHAR encoding of the database.
static EncodingType GetDriverManagerEncoding (  )  [inline, static]

Retrieves the encoding used by the DriverManager for SQLWCHAR* strings.

Returns:
The Driver Manager encoding.
static const simba_char* GetEncodingName ( EncodingType  in_encType  )  [static]

Get the ICU defined encoding name for the input encoding type.

Parameters:
The encoding type.
Returns:
The ICU defined encoding name.
static EncodingType GetInternalEncoding (  )  [inline, static]
simba_int32 GetLength (  )  const

Returns the number of code units in the string. Returns 0 if the string is "null".

simba_int32 GetLengthInBytes (  )  const

Gets the length of the string in bytes.

simba_int32 GetLengthInCodePoints (  )  const

Returns the number of code points in the string. Returns 0 if the string is "null".

simba_byte* GetWritableBuffer (  ) 

Gets a writable buffer for the underlying string data. Call GetBufferLength() to get the length of buffer returned by this call.

This call must be matched with a ReleaseWritableBuffer() call when done reading and writing to the buffer. Between these two calls the string may not be considered vaild. Calls to GetWritableBuffer may not be nested.

Returns NULL if there is no underlying WideStringImpl allocated.

Returns:
Writable buffer for the underlying string data. (NOT OWN)
simba_byte* GetWritableBuffer ( simba_int32  in_length  ) 

Gets a writable buffer for the underlying string data of a specified minimum size.

If in_length is larger than the current buffer length, a new buffer will be allocated and the string data copied to it.

This call must be matched with a ReleaseWritableBuffer() call when done reading and writing to the buffer. Between these two calls the string may not be considered valid. Calls to GetWritableBuffer may not be nested.

If no WideStringImpl is allocated yet, a new one will be created. Returns NULL if a longer buffer could not be allocated.

Parameters:
in_length The minimum length (in bytes) for the writable buffer to be.
Returns:
Writable buffer for the underlying string data. (NOT OWN)
static void InitializeAppCharEncoding (  )  [static]

Sets the encoding used by the standard library function string arguments. This uses the current Locale's encoding as determined by ICU.

void Insert ( simba_int32  in_start,
const simba_wstring in_string 
)

Insert text into string at the offset (codeunit).

bool IsAlpha ( simba_int32  in_index  )  const

Determines whether the given character is a letter.

Parameters:
in_index The index (0-based) of the character to check.
Returns:
True if the given character is a letter; false otherwise.
bool IsAlphaNumeric ( simba_int32  in_index  )  const

Determines whether the given character is letter or a digit.

Parameters:
in_index The index (0-based) of the character to check.
Returns:
True if the given character is a letter or a digit; false otherwise.
bool IsDigit ( simba_int32  in_index  )  const

Determines whether the character at the given index is a digit.

Parameters:
in_index The index (0-based) of the character to check.
Returns:
True if the given character is a digit; false otherwise.
bool IsEmpty (  )  const [inline]

Determine if the string is empty.

Note that "null" strings are also considered empty.

Returns:
True if the string is empty or null; false otherwise.
bool IsEqual ( const simba_wstring in_string,
bool  in_isCaseSensitive = true 
) const

Performs a comparison of the given string to the current string, with optional case sensitivity.

Parameters:
in_string The string to compare against this string.
in_isCaseSensitive True if taking case into account, false otherwise.
Returns:
True if the strings are equal, false otherwise.
bool IsNull (  )  const [inline]

Indicates if the string is considered "NULL".

Returns:
True if the string is NULL, false otherwise.
bool IsWhitespace ( simba_int32  in_index  )  const

Determines whether the character at the given index is whitespace.

Parameters:
in_index The index (0-based) of the character to check.
Returns:
True if the given character is whitespace; false otherwise.
static simba_wstring Join ( Iter  in_first,
Iter  in_end,
const simba_wstring in_separator 
) [inline, static]

Join a range of simba_wstrings using the given separator.

Parameters:
Iter A forward iterator type which dereferences to a simba_wstring.
in_first The beginning of the range.
in_end The end of the range.
in_separator The separator to put in between adjacent strings.

For example, Join(A, B, ", ") where [A, B) is the range ("a", "b", "c") will return "a, b, c".

Returns:
The string constructed by joining the given range of strings with the given separator. If the range is empty, a NULL simba_wstring.
simba_wstring Join ( Iter  in_first,
Iter  in_end 
) const [inline]

Join a range of simba_wstrings using this string as a separator.

Parameters:
Iter A forward iterator type which dereferences to a simba_wstring.
in_first The beginning of the range.
in_end The end of the range.

For example, str.Join(A, B) where [A, B) is the range ("a", "b", "c") and str == ", " will return "a, b, c".

Returns:
The string constructed by joining the given range of strings with this string as a separator. If the range is empty, a NULL simba_wstring.
simba_wstring& LTrim (  ) 

Left trims blank space and tab characters of the string in place.

Returns:
a reference to this trimmed string.
simba_int32 MoveIndex32 ( simba_int32  in_index,
simba_int32  in_delta 
)

Return the code unit index after moving n code points.

Parameters:
in_index The starting code unit index.
in_delta The (signed) code point to move the code unit index backward or forward in the string.
Returns:
the code unit index after the move.
bool operator!= ( const simba_wstring in_rhs  )  const

Is Not Equal operator.

Parameters:
in_rhs 
simba_wstring operator+ ( const simba_wstring in_rhs  )  const

Plus operator.

Parameters:
in_rhs 
simba_wstring& operator+= ( const simba_wstring in_rhs  ) 

Plus Equal (append) operator.

Parameters:
in_rhs 
bool operator< ( const simba_wstring in_rhs  )  const

Less Than operator. "null" strings are considered less than any strings which aren't "null".

Parameters:
in_rhs 
simba_wstring& operator= ( const std::wstring &  in_str  ) 

Assignment operator with NUL-terminated std::wstring input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLWCHAR* SOURCE DATA! SQLWCHAR AND WCHAR_T DO NOT NECESSARILY USE THE SAME ENCODING!

Parameters:
in_str A string.
simba_wstring& operator= ( const simba_string in_str  ) 

Assignment operator with NUL-terminated simba_string input, which has the encoding GetAnsiCharEncoding().

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLCHAR* OR UTF-8 SOURCE DATA! SQLCHAR* MAY NOT NECESSARILY USE THE SAME ENCODING AS simba_char*! UTF-8 MAY NOT TOO!

Parameters:
in_str A string.
simba_wstring& operator= ( const wchar_t *  in_str  ) 

Assignment operator with NUL-terminated wchar_t* input, which has the encoding SIMBA_PLATFORM_WCHAR_ENCODING.

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLWCHAR* SOURCE DATA! SQLWCHAR AND WCHAR_T DO NOT NECESSARILY USE THE SAME ENCODING!

Parameters:
in_str A string. (NOT OWN).
simba_wstring& operator= ( const simba_char in_str  ) 

Assignment operator with NUL-terminated simba_char* input, which has the encoding GetAnsiCharEncoding().

WARNING: DO NOT USE THIS CONSTRUCTOR FOR SQLCHAR* OR UTF-8 SOURCE DATA! SQLCHAR* MAY NOT NECESSARILY USE THE SAME ENCODING AS simba_char*! UTF-8 MAY NOT TOO!

Parameters:
in_str A string. (NOT OWN).
simba_wstring& operator= ( const simba_wstring in_wstr  ) 

Assignment operator.

Parameters:
in_wstr 
bool operator== ( const simba_wstring in_rhs  )  const

Is Equal operator.

Parameters:
in_rhs 
bool PadTrailing ( simba_int32  in_length,
wchar_t  in_char 
)

Pads the end of this string with the given character up until the given length.

This is done in place.

Parameters:
in_length The length to which this string should be padded.
in_char The character to use to pad.
simba_wstring& RegexReplace ( const simba_wstring in_regexPattern,
const simba_wstring in_newValue,
simba_uint32  in_flags = 0 
)

Replaces all instances of in_regexPattern with in_newValue via regular expressions.

Parameters:
in_regexPattern The pattern to find.
in_newValue The value to use as a replacement.
in_flags Pattern matching flags. You can specify more than one. By default, all flags are disabled. SIMBA_REGEX_CASE_INSENSITIVE - case insensitive matching. SIMBA_REGEX_COMMENTS - whitespace and # comments can be used in patterns. SIMBA_REGEX_DOTALL - if set, a '.' matches a line terminator. SIMBA_REGEX_MULTILINE - if set, the '^' and '$' characters match start and end of every line in the input. SIMBA_REGEX_REPLACE_FIRST_ONLY - if set, only the first match will get replaced.
void ReleaseWritableBuffer ( simba_int32  in_newLength = SIMBA_NTS  ) 

Releases a writable buffer.

This call must be matched with an earlier call to GetWritableBuffer().

Parameters:
in_newLength The new length in bytes of the string data. May use SIMBA_NTS to indicate the new data is NUL terminated instead of specifying a length.
void Remove ( simba_int32  start_pos,
simba_int32  length 
)

Removes a range of characters (code Units) from the string starting at the start_pos.

Parameters:
start_pos The offset from which the characters will be removed.
length Amount of code units to remove.
simba_wstring Repeat ( simba_size_t  in_repeatCount  )  const

Create a string that is this string repeated N times.

Parameters:
in_repeatCount The number of times to repeat the string.
Returns:
A string that is this string repeated in_repeatCount times.
void Replace ( const simba_int32  in_offset,
const simba_int32  in_length,
wchar_t  in_srcChar 
)

Replaces a set of instances with a new value at a particular index (code unit).

This operation will be performed in place.

Parameters:
in_offset The offset in code units.
in_length The length to be replaced in code units.
in_srcChar The code unit to use as replacement.
simba_wstring& Replace ( const simba_wstring in_oldValue,
const simba_wstring in_newValue 
)

Replaces all instances of in_oldValue with in_newValue.

This operation will be performed in place.

Parameters:
in_oldValue The value to be replaced.
in_newValue The value to use as a replacement.
Returns:
This modified string.
simba_wstring& RTrim (  ) 

Right trims blank space and tab characters of the string in place.

Returns:
a reference to this trimmed string.
static void SetDatabaseCharEncoding ( EncodingType  in_encType  )  [static]

Sets the encoding used by the Database for SQLCHAR* strings.

Parameters:
in_encType The SQLCHAR encoding of the database.
static void SetDatabaseWCharEncoding ( EncodingType  in_encType  )  [static]

Sets the encoding used by the Database for SQLWCHAR* strings.

Parameters:
in_encType The database SQLWCHAR encoding.
static void SetDriverManagerEncoding ( EncodingType  in_encType  )  [static]

Sets the encoding used by the DriverManager for SQLWCHAR* strings.

Parameters:
in_encType The Driver Manager encoding.
void SetFromUTF8 ( const void *  in_str,
simba_int32  in_length 
)

Sets the simba_wstring value from a UTF-8 encoded buffer.

Parameters:
in_str The UTF-8 encoded buffer to build a simba_wstring from. (NOT OWN)
in_length Count of simba_chars in in_str, or SIMBA_NTS to indicate that in_str is NUL-terminated.
void SetFromUTF8 ( const simba_string in_str  ) 

Set the simba_wstring value from a UTF-8 string.

Parameters:
in_str The UTF-8 string.
simba_wstring& ShrinkToNullChar ( simba_int32  in_startPos = 0  ) 

Truncate the string if it contains a ''.

Search from the given start position for the first null character (''). If one is found, truncate the string to the characters before the null character.

Parameters:
in_startPos The code unit index in the string to start searching from.
Returns:
A reference to the string.
bool StartsWith ( const simba_wstring in_prefix  )  const

Checks whether this string has a prefix of in_prefix.

Parameters:
in_prefix The prefix to check.
Returns:
True if this string begins with in_prefix, False otherwise.
simba_wstring Substr ( simba_int32  in_start,
simba_int32  in_len 
) const

Returns a substring of maximum length in_len code units, starting at the code unit in_start.

Returns an empty string if this string is "null". Throws an ErrorException if the new substring does not start and end on whole code points.

Parameters:
in_start First code unit of substring.
in_len Length of substring in number of code units.
Returns:
The sub-string.
simba_wstring Substr ( simba_int32  in_start  )  const

Returns a substring of maximum length code units, starting at the code unit in_start.

Returns an empty string if this string is "null". Throws an ErrorException if the new substring does not start and end on whole code points.

Parameters:
in_start First code unit of substring.
Returns:
The sub-string.
void Swap ( simba_wstring io_otherString  )  throw ()

Swap the contents of this string with io_otherString. This method is faster than using the copy constructor or assignment operator.

Parameters:
io_otherString The string to swap data with.
simba_wstring Tokenize ( simba_int32 io_pos,
const simba_wstring in_delimiter 
) const

Tokenize the given string based on the input delimiters.

Parameters:
io_pos The position to start the search for tokens. Upon return from this function, io_pos will be updated to 1 past the next delimiter, if one is found. If no token is found, SIMBA_NPOS will be returned.
in_delimiter The delimiter.
Returns:
The next token.
simba_wstring& ToLower (  ) 

Converts the string to an lower case string in place.

Returns:
a reference to the lower case string.
simba_wstring& ToUpper (  ) 

Converts the string to an upper case string in place.

Returns:
a reference to the upper case string.
simba_wstring& Trim (  ) 

Trims the string in place.

Returns:
a reference to the trimmed string.
static size_t WideCharStringLength ( const wchar_t *  in_wideCharString,
size_t  in_numberOfElements 
) [static]

Used for measuring wchar strings' length in code units. Replaces non-standard function wcsnlen when encoding used is not the same as the standard library (system default) encoding for wide char literals.

Parameters:
in_wideCharString The string to be measured. (NOT OWN)
in_numberOfElements The maximum number of elements to be counted. (NOT OWN)
Returns:
The number of characters in the string, not including the terminating null character. If there is no null terminator within the first numberOfElements wide characters, then numberOfElements is returned to indicate the error condition; null-terminated strings have lengths that are strictly less than numberOfElements.
static size_t WideCharStringLength ( const wchar_t *  in_wideCharString  )  [static]

Used for measuring wchar strings' length in code units. Replaces wcslen when encoding used is not the same as the standard library (system default) encoding for wide char literals.

Parameters:
in_wideCharString The string to be measured. (NOT OWN)
Returns:
The length of the input expressed in units of the current platform's code units.

Friends And Related Function Documentation

friend class ODBCStringConverter [friend]
friend class TimestampTzConverter [friend]
friend class WideStringConverter [friend]

Member Data Documentation

Flag indicating that the regex should use case insensitive matching.

Flag indicating that whitespace and comments can be used in patterns.

Flag indicating that a '.' matches a line terminator..

Flag indicating that '^' and '$' characters match the start and end of every line in the input.

Flag indicating only the first match will be replaced.


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba