PrevNextUpHome SophiaFramework UNIVERSE 5.1
SFXAnsiString
Class which represents a string of AChar type.
#include <SFXAnsiString.h.hpp>
class SFXAnsiString;
SFMTYPEDEFCLASS(SFXAnsiString)

Collaboration diagram

 Collaboration diagram of SFXAnsiStringClass

Description

SFXAnsiString and SFXWideString

In the BREW environment, there are two kinds of character types: the char type that represents single byte character or multi-byte character, and the AECHAR type that represents 2 byte character.

SophiaFramewok defines these two kinds of types as AChar and WChar respectively.

And SophiaFramework provides two kinds of String classes: the SFXAnsiString class for the string of AChar characters and the SFXWideString class for the string of WChar characters.

How to Empty a String

There are two methods to empty a string:

In the former method, its heap is not released. By block allocation support, to allocate new memory is unnecessary when a string is newly created in this heap. Therefore its processing speed is very fast.

In the latter method, its heap is released. Though the released heap is free for other tasks, its processing speed slows down.

Which method to choose depends upon the trade-off between processing speed and memory usage.

Example 805. Method 1: Substitute an empty string or call the SFXAnsiString::SetLength function:

SFXAnsiString str = "The best C++ Programming Environment for BREW";

str = ";
// OR:
str.SetLength(0);

// the heap is not released

Example 806. Method 2: Call the Clear function:

SFXAnsiString str = "The best C++ Programming Environment for BREW";

str.Clear();

// the heap is released

When short strings are frequently processed, the method of calling the SFXAnsiString::SetLength function is more efficient.

SFXAnsiString str;

str = "BREW";
...
str.SetLength(0);
...
str = "C++";
...
str.SetLength(0);
...
str = "GUI";
...
str.SetLength(0);
...
str = "XML";
...

Attach Function and Detach Function

The SFXAnsiString::Attach function function attaches the string area to the SFXAnsiString object. The SFXAnsiString::Detach function has the reverse functionality.

Though the data is copied by using the SFXAnsiString::Set function and the substitution operator(=), while using the SFXAnsiString::Attach function and the SFXAnsiString::Detach function, data will not be copied.

When there is not enough heap for copying a several hundreds KB string, or to avoid the performance deterioration, use these functions.

Reference

SFXWideString | SFXBuffer

Member

Constructor/Destructor
SFXAnsiString( Void )
Constructor of the SFXAnsiString class.
SFXAnsiString( SFXAnsiStringConstRef string )
Constructor of the SFXAnsiString class.
SFXAnsiString( SFXWideStringConstRef string )
Constructor of the SFXAnsiString class.
SFXAnsiString( ACharConstPtr string , SInt32 length = -1 )
Constructor of the SFXAnsiString class.
SFXAnsiString( WCharConstPtr string , SInt32 length = -1 )
Constructor of the SFXAnsiString class.
SFXAnsiString( AChar character )
Constructor of the SFXAnsiString class.
SFXAnsiString( SFXBufferConstRef buffer )
Constructor of the SFXAnsiString class.
SFXAnsiString( UInt16 threshold , UInt16 cluster )
Constructor of the SFXAnsiString class.
~SFXAnsiString( Void )
Destructor of the SFXAnsiString class.
Public Functions
SFCError Add( SFXAnsiStringConstRef string )
Add the specified string to the end of the current string.
SFCError Add( ACharConstPtr string , SInt32 length = -1 )
Add the specified string to the end of the current string.
SFCError Add( AChar character )
Add the specified string to the end of the current string.
SFXAnsiString AsLower( Void )
Convert the string into lower characters.
SInt32 AsSInt32( SInt32 substitute = 0 )
Convert the string into SInt32 type.
UInt32 AsUInt32( UInt32 substitute = 0 )
Convert the string into UInt32 type.
SFXAnsiString AsUpper( Void )
Convert the string into capital character.
SFCError Attach( SFXAnsiStringPtr string )
Attach the specified string to this string object.
SFCError Attach( ACharPtr string , SInt32 length = -1 )
Attach the specified string to this string object.
SFCError Attach( SFXBufferPtr buffer )
Attach the specified string to this string object.
SFCError AttachSFXBuffer( SFXBufferPtr buffer )
[DEPRECATED]Attach the specified buffer to this string object.
Void Clear( Void )
Clear the string.
SInt32 Compare( SFXAnsiStringConstRef string , Bool sensitive = true )
Compare with a specified string by dictionary order.
SInt32 Compare( ACharConstPtr string , Bool sensitive = true )
Compare with a specified string by dictionary order.
SFXAnsiString Concat( SFXAnsiStringConstRef string )
Concatenate the specified string to the end of this string and return the result.
SFXAnsiString Concat( ACharConstPtr string , SInt32 length = -1 )
Concatenate the specified string to the end of this string and return the result.
SFXAnsiString Concat( AChar character )
Concatenate the specified string to the end of this string and return the result.
SFCError Copy( SInt32 index , SFXAnsiStringConstRef string )
Overwrite with a specified string.
SFCError Copy( SInt32 index , ACharConstPtr string , SInt32 length = -1 )
Overwrite with a specified string.
SFCError Detach( SFXAnsiStringPtr string )
Detach the string area from this string object.
ACharPtr Detach( SInt32Ptr length = null )
Detach the string area from this string object.
SFCError Detach( SFXBufferPtr buffer )
Detach the string area from this string object.
SFCError DetachSFXBuffer( SFXBufferPtr buffer )
[DEPRECATED]Detach the string area from this string object.
static
SFXAnsiStringConstRef
EmptyInstance( Void )
Get an empty string.
Bool EndsWith( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether the string ends with a specified string or not.
Bool EndsWith( ACharConstPtr string , Bool sensitive = true )
Check whether the string ends with a specified string or not.
Bool EndsWith( AChar character , Bool sensitive = true )
Check whether the string ends with a specified string or not.
Bool Equals( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether the string equals a specified string or not.
Bool Equals( ACharConstPtr string , Bool sensitive = true )
Check whether the string equals a specified string or not.
Void Fill( AChar character )
Fill the string with a specified character.
SInt32 FirstIndexOf( SFXAnsiStringConstRef string , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of SFXAnsiString object to match a specified data, searching from the beginning.
SInt32 FirstIndexOf( ACharConstPtr string , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of SFXAnsiString object to match a specified data, searching from the beginning.
SInt32 FirstIndexOf( AChar character , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of SFXAnsiString object to match a specified data, searching from the beginning.
static
SFXAnsiString
Format( va_ref< SFXAnsiStringConst > format , ... )
Create a string by using the format.
static
SFXAnsiString
Format( va_ref< SFXWideStringConst > format , ... )
Create a string by using the format.
static
SFXAnsiString
Format( ACharConstPtr format , ... )
Create a string by using the format.
static
SFXAnsiString
Format( WCharConstPtr format , ... )
Create a string by using the format.
static
SFXAnsiString
FormatV( SFXAnsiStringConstRef format , va_list argument )
Create a string by using the format with a variable-length argument.
static
SFXAnsiString
FormatV( SFXWideStringConstRef format , va_list argument )
Create a string by using the format with a variable-length argument.
static
SFXAnsiString
FormatV( ACharConstPtr format , va_list argument )
Create a string by using the format with a variable-length argument.
static
SFXAnsiString
FormatV( WCharConstPtr format , va_list argument )
Create a string by using the format with a variable-length argument.
ACharPtr GetBuffer( Void )
Get the internal buffer of string.
ACharConstPtr GetBuffer( Void )
Get the internal buffer of string.
ACharConstPtr GetCString( Void )
Get the const pointer to the internal buffer of string. The buffer cannot be updated through this pointer.
AChar GetChar( SInt32 index )
Get the character at a specified index.
UInt16 GetCluster( Void )
Get the cluster size of the internal buffer memory. [in bytes]
SInt32 GetLength( Void )
Get the length of string.
SInt32 GetLengthCString( Void )
Get the length of string until the first null character.
UInt16 GetThreshold( Void )
Get the minimum size of the internal buffer memory. [in bytes]
SFXAnsiString Insert( SInt32 index , SFXAnsiStringConstRef string )
Insert a string or character at a specified index of SFXAnsiString object.
SFXAnsiString Insert( SInt32 index , ACharConstPtr string , SInt32 length = -1 )
Insert a string or character at a specified index of SFXAnsiString object.
SFXAnsiString Insert( SInt32 index , AChar character )
Insert a string or character at a specified index of SFXAnsiString object.
Bool IsAlpha( Void )
Check whether all the characters in the string are alphabetic or not.
Bool IsAlphaDigit( Void )
Check whether all the characters in the string are alphanumeric or not.
Bool IsAscii( Void )
Check whether all the characters in the string are Ascii or not.
Bool IsControl( Void )
Check whether all the characters in the string are control or not.
Bool IsDigit( Void )
Check whether all the characters in the string are digit or not.
Bool IsEmpty( Void )
Check whether the length of string is 0 or not.
Bool IsEmptyCString( Void )
Check whether the first character is a null or not.
Bool IsGraph( Void )
Check whether all the characters in the string are graph or not.
Bool IsHexDigit( Void )
Check whether all the characters in the string are Hex digit or not.
Bool IsLower( Void )
Check whether all the characters in the string are lower or not.
Bool IsPrint( Void )
Check whether all the characters in the string are printable or not.
Bool IsPunct( Void )
Check whether all the characters in the string are not space nor alphanumeric but printable or not.
Bool IsSpace( Void )
Check whether or not all the characters in the string are spaces or line-feed.
Bool IsUpper( Void )
Check whether all the characters in the string are capital or not.
Bool Isnull( Void )
Check whether all the characters in the string are null or not.
SInt32 LastIndexOf( SFXAnsiStringConstRef string , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of SFXAnsiString object to match a specified data, searching from the end.
SInt32 LastIndexOf( ACharConstPtr string , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of SFXAnsiString object to match a specified data, searching from the end.
SInt32 LastIndexOf( AChar character , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of SFXAnsiString object to match a specified data, searching from the end.
SFCError Mul( SInt32 repeat )
Repeat the string by a specified times.
SFXAnsiString Remove( SInt32 begin , SInt32 end )
Remove the characters within a specified range.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , ACharConstPtr tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , ACharConstPtr tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , AChar tcharacter , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( AChar fcharacter , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( AChar fcharacter , AChar tcharacter , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , AChar tcharacter , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , AChar tcharacter , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( AChar fcharacter , ACharConstPtr tstring , Bool sensitive = true )
Replace the string.
SFXAnsiString Replace( AChar fcharacter , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Replace the string.
SFCError Set( SFXAnsiStringConstRef string )
Set the string.
SFCError Set( SFXWideStringConstRef string )
Set the string.
SFCError Set( ACharConstPtr string , SInt32 length = -1 )
Set the string.
SFCError Set( WCharConstPtr string , SInt32 length = -1 )
Set the string.
SFCError Set( AChar character )
Set the string.
SFCError Set( SFXBufferConstRef buffer )
Set the string.
SFCError SetChar( SInt32 index , AChar character )
Set a character at a specified index.
Void SetCluster( UInt16 size )
Set the cluster size of the internal buffer memory. [in bytes]
SFCError SetLength( SInt32 length )
Set the length of string.
Void SetThreshold( UInt16 size )
Set the minimum size of the internal buffer memory. [in bytes]
Bool StartsWith( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether the string starts with a specified string or not.
Bool StartsWith( ACharConstPtr string , Bool sensitive = true )
Check whether the string starts with a specified string or not.
Bool StartsWith( AChar character , Bool sensitive = true )
Check whether the string starts with a specified string or not.
SFCError Sub( SFXAnsiStringConstRef string )
Delete a specified string from the end of source string.
SFCError Sub( ACharConstPtr string , SInt32 length = -1 )
Delete a specified string from the end of source string.
SFCError Sub( AChar character )
Delete a specified string from the end of source string.
SFXAnsiString Substring( SInt32 begin , SInt32 end )
Get the sub-string from the source string.
Void ToLower( Void )
Convert the string into lower characters.
Void ToUpper( Void )
Convert the string into capital characters.
SFXAnsiString Trim( SFXAnsiStringConstRef string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning and end of source string.
SFXAnsiString Trim( ACharConstPtr string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning and end of source string.
SFXAnsiString Trim( AChar character , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning and end of source string.
SFXAnsiString Trim( Void )
Trim the blank characters or a specified string/character from the beginning and end of source string.
SFXAnsiString TrimLeft( SFXAnsiStringConstRef string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning of source string.
SFXAnsiString TrimLeft( ACharConstPtr string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning of source string.
SFXAnsiString TrimLeft( AChar character , Bool sensitive = true )
Trim the blank characters or a specified string/character from the beginning of source string.
SFXAnsiString TrimLeft( Void )
Trim the blank characters or a specified string/character from the beginning of source string.
SFXAnsiString TrimRight( SFXAnsiStringConstRef string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the end of source string.
SFXAnsiString TrimRight( ACharConstPtr string , Bool sensitive = true )
Trim the blank characters or a specified string/character from the end of source string.
SFXAnsiString TrimRight( AChar character , Bool sensitive = true )
Trim the blank characters or a specified string/character from the end of source string.
SFXAnsiString TrimRight( Void )
Trim the blank characters or a specified string/character from the end of source string.
SFXAnsiString Truncate( Void )
Get the string until the first "null" character.
SFXAnsiStringRef operator*=( SInt32 repeat )
Repeat the string by a specified times.
SFXAnsiStringRef operator+=( SFXAnsiStringConstRef string )
Add string.
SFXAnsiStringRef operator+=( ACharConstPtr string )
Add string.
SFXAnsiStringRef operator+=( AChar character )
Add string.
SFXAnsiStringRef operator-=( SFXAnsiStringConstRef string )
Delete a specified string from the end of source string.
SFXAnsiStringRef operator-=( ACharConstPtr string )
Delete a specified string from the end of source string.
SFXAnsiStringRef operator-=( AChar character )
Delete a specified string from the end of source string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , SFXAnsiStringConstRef right )
Append a string on the end of string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , SFXWideStringConstRef right )
Append a string on the end of string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , ACharConstPtr right )
Append a string on the end of string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , WCharConstPtr right )
Append a string on the end of string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , AChar right )
Append a string on the end of string.
SFXAnsiStringRef operator=( SFXAnsiStringConstRef string )
Substitute the string with a specified string.
SFXAnsiStringRef operator=( SFXWideStringConstRef string )
Substitute the string with a specified string.
SFXAnsiStringRef operator=( ACharConstPtr string )
Substitute the string with a specified string.
SFXAnsiStringRef operator=( WCharConstPtr string )
Substitute the string with a specified string.
ACharRef operator[]( SInt32 index )
Get the character at a specified index.
ACharConstRef operator[]( SInt32 index )
Get the character at a specified index.
Bool operator==( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "=" relation.
Bool operator==( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator==( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator>=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the ">=" relation.
Bool operator>=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the ">" relation.
Bool operator>( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator>( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator<=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "<=" relation.
Bool operator<=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "<" relation.
Bool operator<( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "<" relation.
Bool operator<( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "<" relation.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , ACharConstPtr right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , WCharConstPtr right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( ACharConstPtr left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( WCharConstPtr left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , AChar right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( AChar left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator*( SFXAnsiStringConstRef left , SInt32 right )
Repeat the string by a specified times.
Bool operator!=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "!=" relation.
Bool operator!=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "!=" relation.
Bool operator!=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "!=" relation.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , ACharConstPtr right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , WCharConstPtr right )
Add string.
SFXAnsiString operator+( ACharConstPtr left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( WCharConstPtr left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , AChar right )
Add string.
SFXAnsiString operator+( AChar left , SFXAnsiStringConstRef right )
Add string.
Types
DefaultEnum
Constants that represent the default values for the minimum size and the cluster size of the internal buffer memory. [in bytes]
Global Functions
Bool operator==( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "=" relation.
Bool operator==( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "=" relation.
Bool operator==( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator==( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "=" relation.
Bool operator>=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the ">=" relation.
Bool operator>=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the ">=" relation.
Bool operator>=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the ">=" relation.
Bool operator>( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the ">" relation.
Bool operator>( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the ">" relation.
Bool operator>( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator>( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the ">" relation.
Bool operator<=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "<=" relation.
Bool operator<=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "<=" relation.
Bool operator<=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "<=" relation.
Bool operator<( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "<" relation.
Bool operator<( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "<" relation.
Bool operator<( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "<" relation.
Bool operator<( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "<" relation.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , ACharConstPtr right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , WCharConstPtr right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( ACharConstPtr left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( WCharConstPtr left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , AChar right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator-( AChar left , SFXAnsiStringConstRef right )
Delete a specified string from the end of left-hand string.
SFXAnsiString operator*( SFXAnsiStringConstRef left , SInt32 right )
Repeat the string by a specified times.
Bool operator!=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check the "!=" relation.
Bool operator!=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check the "!=" relation.
Bool operator!=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check the "!=" relation.
Bool operator!=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check the "!=" relation.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , ACharConstPtr right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , WCharConstPtr right )
Add string.
SFXAnsiString operator+( ACharConstPtr left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( WCharConstPtr left , SFXAnsiStringConstRef right )
Add string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , AChar right )
Add string.
SFXAnsiString operator+( AChar left , SFXAnsiStringConstRef right )
Add string.

SFXAnsiString::SFXAnsiString
Constructor of the SFXAnsiString class.
[ public, explicit ]
SFXAnsiString(Void);
[ public ]
SFXAnsiString(
    SFXAnsiStringConstRef string   // source string for copying
);
[ public ]
SFXAnsiString(
    SFXWideStringConstRef string   // source string for copying
);
[ public ]
SFXAnsiString(
    ACharConstPtr string   // WChar pointer to Source string for copying
    SInt32 length = -1     // length of string
);
[ public ]
SFXAnsiString(
    WCharConstPtr string   // WChar pointer to Source string for copying
    SInt32 length = -1     // length of string
);
[ public, explicit ]
SFXAnsiString(
    AChar character   // AChar string
);
[ public, explicit ]
SFXAnsiString(
    SFXBufferConstRef buffer   // source buffer for copying
);
[ public, explicit ]
SFXAnsiString(
    UInt16 threshold   // the mininum value of buffer size
    UInt16 cluster     // cluster size
);

Description

When the SFXAnsiString class or the SFXWideString class is specified for the constructor of the SFXAnsiString class, the string is copied.

If the pointer of AChar or WChar is specified, it is interpreted and copied as a null-terminated string.

If the length is specified, binary string contains null can be processed, too.

When AChar is specified, only one character is made.

Reference

SFXAnsiString::Set | SFXAnsiString::operator=


SFXAnsiString::~SFXAnsiString
Destructor of the SFXAnsiString class.
[ public ]
~SFXAnsiString(Void);

Description

The internal string buffer is released.


SFXAnsiString::Add
Add the specified string to the end of the current string.
[ public ]
SFCError Add(
    SFXAnsiStringConstRef string   // string to add
);
[ public ]
SFCError Add(
    ACharConstPtr string   // string to add
    SInt32 length = -1     // length of the string
);
[ public ]
SFCError Add(
    AChar character   // character to add
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY
  • Otherwise: SFERR_FAILED

Description

This function adds the specified string to the end of the current string.

This function influences the content of the current string. If you want to keep it unmodified, use the SFXAnsiString::Concat function.

Reference

SFXAnsiString::Concat | SFXAnsiString::Sub | SFXAnsiString::Mul | SFXAnsiString::operator<< | operator+ | SFXAnsiString::operator+=


SFXAnsiString::AsLower
Convert the string into lower characters.
[ public, const ]
SFXAnsiString AsLower(Void);

Description

The source string will not be modified by calling the AsLower() function.

Reference

SFXAnsiString::AsUpper | SFXAnsiString::ToLower


SFXAnsiString::AsSInt32
Convert the string into SInt32 type.
[ public, const ]
SInt32 AsSInt32(
    SInt32 substitute = 0   // the value when the conversion is failed
);

Description

If unable to convert, a specified value is returned to substitute.

Reference

SFXAnsiString::AsUInt32


SFXAnsiString::AsUInt32
Convert the string into UInt32 type.
[ public, const ]
UInt32 AsUInt32(
    UInt32 substitute = 0   // the value when the conversion is failed
);

Description

If unable to convert, a specified value is returned to substitute.

Reference

SFXAnsiString::AsSInt32


SFXAnsiString::AsUpper
Convert the string into capital character.
[ public, const ]
SFXAnsiString AsUpper(Void);

Description

The source string will not be modified by calling the AsUpper() function.

Reference

SFXAnsiString::AsLower | SFXAnsiString::ToUpper


SFXAnsiString::Attach
Attach the specified string to this string object.
[ public ]
SFCError Attach(
    SFXAnsiStringPtr string   // SFXAnsiString string
);
[ public ]
SFCError Attach(
    ACharPtr string      // AChar string
    SInt32 length = -1   // length of the string
);
[ public ]
SFCError Attach(
    SFXBufferPtr buffer   // SFXBuffer buffer
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the argument is null: SFERR_INVALID_PARAM

Description

This function attaches the specified string to this string object. After this function is called, the specified string can be handled as the SFXAnsiString object.

This function is more efficient than the SFXAnsiString::Set function, since the string is not copied and the problem on insufficient memory or performance deterioration can be avoided.

[Note] Note
When this string object is released, the specified string will be released automatically together with this string object.

Example

SFXAnsiString string;
ACharPtr char_ptr;

// allocate the 10240-byte string area to char_ptr
char_ptr = static_cast<ACharPtr>(MemoryAllocate(10240));

...

// attach the allocated char_ptr area to the string object
string.Attach(char_ptr, 10240);

// hereafter, the allocated char_ptr area can be handled as the string object

・・・

// after used, the allocated char_ptr area will be released automatically

Reference

SFXAnsiString::Detach


SFXAnsiString::AttachSFXBuffer
[DEPRECATED]Attach the specified buffer to this string object.
[ public ]
SFCError AttachSFXBuffer(
    SFXBufferPtr buffer   // buffer
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the argument is null: SFERR_INVALID_PARAM

Description

[Caution] Caution
Since this function is deprecated, use the SFXAnsiString::Attach function.

Reference

SFXAnsiString::Attach | SFXAnsiString::Detach | SFXAnsiString::DetachSFXBuffer


SFXAnsiString::Clear
Clear the string.
[ public ]
Void Clear(Void);

Description

It releases the heap.


SFXAnsiString::Compare
Compare with a specified string by dictionary order.
[ public, const ]
SInt32 Compare(
    SFXAnsiStringConstRef string   // string to cpmpare with
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
SInt32 Compare(
    ACharConstPtr string    // string to cpmpare with
    Bool sensitive = true   // case-sensitive or not
);

Return value

  • If the string is less than a specified string : Minus value
  • If the string equals a specified string : 0
  • If the string is greater than a specified string : Positive value

Reference

SFXAnsiString::Equals | operator== | operator!=


SFXAnsiString::Concat
Concatenate the specified string to the end of this string and return the result.
[ public, const ]
SFXAnsiString Concat(
    SFXAnsiStringConstRef string   // string to concatenate with
);
[ public, const ]
SFXAnsiString Concat(
    ACharConstPtr string   // string to concatenate with
    SInt32 length = -1     // length of the string
);
[ public, const ]
SFXAnsiString Concat(
    AChar character   // character to concatenate with
);

Return value

Concatenated string.

Description

This function concatenates the specified string to the end of this string and returns the result.

Different from the SFXAnsiString::Add function, this string will not be modified.

Reference

SFXAnsiString::Add | operator+ | SFXAnsiString::operator+=


SFXAnsiString::Copy
Overwrite with a specified string.
[ public ]
SFCError Copy(
    SInt32 index                   // starting position to overwrite
    SFXAnsiStringConstRef string   // string to overwrite with
);
[ public ]
SFCError Copy(
    SInt32 index           // starting position to overwrite
    ACharConstPtr string   // string to overwrite with
    SInt32 length = -1     // length of the string
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If exceeds the end of source string : SFERR_INVALID_PARAM

Description

If the string after overwriting exceeds the end of source string, the source string is restored and return SFERR_INVALID_PARAM.


SFXAnsiString::Detach
Detach the string area from this string object.
[ public ]
SFCError Detach(
    SFXAnsiStringPtr string   // SFXAnsiString string to be detached
);
[ public ]
ACharPtr Detach(
    SInt32Ptr length = null   // the pointer to the length of the AChar string to be detached
);
[ public ]
SFCError Detach(
    SFXBufferPtr buffer   // SFXBuffer string to be detached
);

Return value

Return the string which this string object has in case it is detached to the AChar string. Otherwise, return the SFCError object.

Description

This function is more efficient than the SFXAnsiString::GetChar function, since the string area is not copied and the problem on insufficient memory or performance deterioration can be avoided.

Example

SFXAnsiString string;
ACharPtr char_ptr;
SInt32 length;

string = "The best application for BREW.";

...

// detach the string area from this string object and set the char_ptr variable to this pointer
// the size of the detached string area will be stored into the length variable
char_ptr = string.Detach(&length);

// hereafter, the string area of the string object will be handled via the char_ptr variable

...

// after used, the detached string area must be released explicitly
MemoryFree(char_ptr);

Reference

SFXAnsiString::Attach


SFXAnsiString::DetachSFXBuffer
[DEPRECATED]Detach the string area from this string object.
[ public ]
SFCError DetachSFXBuffer(
    SFXBufferPtr buffer   // pointer to the buffer to be detached
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the argument is null: SFERR_INVALID_PARAM

Description

[Caution] Caution
Since this function is deprecated, use the SFXAnsiString::Detach function.

Reference

SFXAnsiString::Attach | SFXAnsiString::AttachSFXBuffer | SFXAnsiString::Detach


SFXAnsiString::EmptyInstance
Get an empty string.
[ public, static ]
SFXAnsiStringConstRef EmptyInstance(Void);

Description

Return the reference to the instance of enpty string as the return value of function.


SFXAnsiString::EndsWith
Check whether the string ends with a specified string or not.
[ public, const ]
Bool EndsWith(
    SFXAnsiStringConstRef string   // string to check with
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
Bool EndsWith(
    ACharConstPtr string    // string to check with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
Bool EndsWith(
    AChar character         // string to check with
    Bool sensitive = true   // case-sensitive or not
);

Return value

  • If ends with a specified string: true
  • Otherwise: false

Reference

SFXAnsiString::StartsWith


SFXAnsiString::Equals
Check whether the string equals a specified string or not.
[ public, const ]
Bool Equals(
    SFXAnsiStringConstRef string   // string to compare with
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
Bool Equals(
    ACharConstPtr string    // string to compare with
    Bool sensitive = true   // case-sensitive or not
);

Return value

  • If equals a specified string: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | operator== | operator!=


SFXAnsiString::Fill
Fill the string with a specified character.
[ public ]
Void Fill(
    AChar character   // character
);

SFXAnsiString::FirstIndexOf
Get the first index of SFXAnsiString object to match a specified data, searching from the beginning.
[ public, const ]
SInt32 FirstIndexOf(
    SFXAnsiStringConstRef string    // string to match
    SInt32 index = SINT32_MINIMUM   // beginning index to search from
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SInt32 FirstIndexOf(
    ACharConstPtr string            // string to  match
    SInt32 index = SINT32_MINIMUM   // beginning index to search from
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SInt32 FirstIndexOf(
    AChar character                 // character to match
    SInt32 index = SINT32_MINIMUM   // beginning index to search from
    Bool sensitive = true           // case-sensitive or not
);

Return value

  • If succeeds : The first index where found.
  • If failed : -1

Description

To search from other than the beginning, specify the beginning index to match. (The origin index is 0.)

Reference

SFXAnsiString::LastIndexOf


SFXAnsiString::Format
Create a string by using the format.
[ public, static ]
SFXAnsiString Format(
    va_ref< SFXAnsiStringConst > format   // string that represents a format
    ...                                   // data
);
[ public, static ]
SFXAnsiString Format(
    va_ref< SFXWideStringConst > format   // string that represents a format
    ...                                   // data
);
[ public, static ]
SFXAnsiString Format(
    ACharConstPtr format   // string that represents a format
    ...                    // data
);
[ public, static ]
SFXAnsiString Format(
    WCharConstPtr format   // string that represents a format
    ...                    // data
);

Description

The SFXAnsiString::Format function is almost the same as the printf function in C language, the format on float is not available.

Example

SIntN year = 2003;
SIntN month = 8;
SFXAnsiString str = SFXAnsiString::Format("%d Year %d Month ", year, month);

Reference

BREW API VSNPRINTF


SFXAnsiString::FormatV
Create a string by using the format with a variable-length argument.
[ public, static ]
SFXAnsiString FormatV(
    SFXAnsiStringConstRef format   // string that represents a format
    va_list argument               // variable-length argument
);
[ public, static ]
SFXAnsiString FormatV(
    SFXWideStringConstRef format   // string that represents a format
    va_list argument               // variable-length argument
);
[ public, static ]
SFXAnsiString FormatV(
    ACharConstPtr format   // string that represents a format
    va_list argument       // variable-length argument
);
[ public, static ]
SFXAnsiString FormatV(
    WCharConstPtr format   // string that represents a format
    va_list argument       // variable-length argument
);

Description

The SFXAnsiString::FormatV function is almost the same as the printf function in C language, the format on float is not available.

Example

SFXAnsiString MyClass::variableArgument(SInt32 arg_num , ...) 
{
    va_list argument;

	va_start(argument, arg_num);
    
	SFXAnsiString str = SFXAnsiString::FormatV("%d Year %d Month %d Day %d Time %d Minute %d Second, It is %s today.", argument);
    
	va_end(argument);
   
	return str;

}

SFXAnsiString str = variableArgument(7, 2007, 7, 17, 17, 37, 50,"rainy");
// str = " 2007 Year 7 Month 17 Day 17 Time 37 Minute 50 Second, It is rainy today."

Reference

BREW API VSNPRINTF


SFXAnsiString::GetBuffer
Get the internal buffer of string.
[ public ]
ACharPtr GetBuffer(Void);
[ public, const ]
ACharConstPtr GetBuffer(Void);

Description

The SFXAnsiString::GetBuffer function cannot access the buffer area that is over the return value of SFXAnsiString::GetLength function

The SFXAnsiString::GetBuffer function returns a null when the string is empty. Data cannot be read from the null pointer.

It is necessary to confirm that the return value of SFXAnsiString::GetBuffer function is not a null.

Reference

SFXAnsiString::GetChar | SFXAnsiString::SetChar | SFXAnsiString::GetLength | SFXAnsiString::SetLength | SFXAnsiString::GetCString


SFXAnsiString::GetCString
Get the const pointer to the internal buffer of string. The buffer cannot be updated through this pointer.
[ public, const ]
ACharConstPtr GetCString(Void);

Description

The SFXAnsiString::GetCString function returns the internal buffer of string as ACharConstPtr type.

The SFXAnsiString::GetCString function returns a pointer to "\0" if the string is empty.

As the pointer returned by the SFXAnsiString::GetCString function is const, data cannot be written to the internal buffer through the pointer.

To write to the internal buffer, use the SFXAnsiString::GetBuffer function.

Reference

SFXAnsiString::GetBuffer


SFXAnsiString::GetChar
Get the character at a specified index.
[ public, const ]
AChar GetChar(
    SInt32 index   // index to get the character
);

Description

Get the character of intenal buffer at a specified index.

Whether the buffer is null or a specified index value is valid is not checked.

Reference

SFXAnsiString::GetBuffer | SFXAnsiString::SetChar


SFXAnsiString::GetCluster
Get the cluster size of the internal buffer memory. [in bytes]
[ public, const ]
UInt16 GetCluster(Void);

Reference

SFXAnsiString::SetCluster


SFXAnsiString::GetLength
Get the length of string.
[ public, const ]
SInt32 GetLength(Void);

Reference

SFXAnsiString::GetLengthCString | SFXAnsiString::SetLength


SFXAnsiString::GetLengthCString
Get the length of string until the first null character.
[ public, const ]
SInt32 GetLengthCString(Void);

Example

SFXAnsiString str("abc\0abc", 7);
int i;
i = str.GetLengthCString(); // i = 3
i = str.GetLength();        // i = 7

Reference

SFXAnsiString::GetLength


SFXAnsiString::GetThreshold
Get the minimum size of the internal buffer memory. [in bytes]
[ public, const ]
UInt16 GetThreshold(Void);

Reference

SFXAnsiString::SetThreshold


SFXAnsiString::Insert
Insert a string or character at a specified index of SFXAnsiString object.
[ public, const ]
SFXAnsiString Insert(
    SInt32 index                   // index to insert
    SFXAnsiStringConstRef string   // string to insert
);
[ public, const ]
SFXAnsiString Insert(
    SInt32 index           // index to insert
    ACharConstPtr string   // string to insert
    SInt32 length = -1     // lengh of string to insert
);
[ public, const ]
SFXAnsiString Insert(
    SInt32 index      // index to insert
    AChar character   // character to insert
);

Description

Insert a string or character at a specified index of SFXAnsiString object. The string of current SFXAnsiString object will not be modified.


SFXAnsiString::IsAlpha
Check whether all the characters in the string are alphabetic or not.
[ public, const ]
Bool IsAlpha(Void);

Return value

  • If all the characters in the string are alphabetic, or empty: true
  • Otherwise: false

SFXAnsiString::IsAlphaDigit
Check whether all the characters in the string are alphanumeric or not.
[ public, const ]
Bool IsAlphaDigit(Void);

Return value

  • If all the characters in the string are alphanumeric, or empty: true
  • Otherwise: false

SFXAnsiString::IsAscii
Check whether all the characters in the string are Ascii or not.
[ public, const ]
Bool IsAscii(Void);

Return value

  • If all the characters in the string are Ascii, or empty: true
  • Otherwise: false

SFXAnsiString::IsControl
Check whether all the characters in the string are control or not.
[ public, const ]
Bool IsControl(Void);

Return value

  • If all the characters in the string are control, or empty: true
  • Otherwise: false

SFXAnsiString::IsDigit
Check whether all the characters in the string are digit or not.
[ public, const ]
Bool IsDigit(Void);

Return value

  • If all the characters in the string are digit, or empty: true
  • Otherwise: false

SFXAnsiString::IsEmpty
Check whether the length of string is 0 or not.
[ public, const ]
Bool IsEmpty(Void);

Return value

  • If the length of string is 0: true
  • Otherwise: false

Reference

SFXAnsiString::IsEmptyCString | SFXAnsiString::GetLength


SFXAnsiString::IsEmptyCString
Check whether the first character is a null or not.
[ public, const ]
Bool IsEmptyCString(Void);

Return value

  • If the first character is a null: true
  • Otherwise: false

Example

SFXAnsiString str("\0abc", 4);
Bool b;
b = str.IsEmptyCString(); // b = true
b = str.IsEmpty();        // b = false

Reference

SFXAnsiString::IsEmpty | SFXAnsiString::GetLength


SFXAnsiString::IsGraph
Check whether all the characters in the string are graph or not.
[ public, const ]
Bool IsGraph(Void);

Return value

  • If all the characters in the string are graph, or empty: true
  • Otherwise: false

SFXAnsiString::IsHexDigit
Check whether all the characters in the string are Hex digit or not.
[ public, const ]
Bool IsHexDigit(Void);

Return value

  • If all the characters in the string are Hex digit, or empty: true
  • Otherwise: false

Description

The SFXAnsiString::IsHexDigit function checks whether or not the string is consisted of the digit, or a, b, c, d, e, f, A, B, C, D, E, F.


SFXAnsiString::IsLower
Check whether all the characters in the string are lower or not.
[ public, const ]
Bool IsLower(Void);

Return value

  • If all the characters in the string are lower, or empty: true
  • Otherwise: false

SFXAnsiString::Isnull
Check whether all the characters in the string are null or not.
[ public, const ]
Bool Isnull(Void);

Return value

  • If all the characters in the string are null, or empty: true
  • Otherwise: false

SFXAnsiString::IsPrint
Check whether all the characters in the string are printable or not.
[ public, const ]
Bool IsPrint(Void);

Return value

  • If all the characters in the string are printable, or empty: true
  • Otherwise: false

SFXAnsiString::IsPunct
Check whether all the characters in the string are not space nor alphanumeric but printable or not.
[ public, const ]
Bool IsPunct(Void);

Return value

  • If all the characters in the string are not space nor alphanumeric but printable, or empty: true
  • Otherwise: false

SFXAnsiString::IsSpace
Check whether or not all the characters in the string are spaces or line-feed.
[ public, const ]
Bool IsSpace(Void);

Return value

  • If all the characters in the string are spaces or line-feed, or empty: true
  • Otherwise: false

SFXAnsiString::IsUpper
Check whether all the characters in the string are capital or not.
[ public, const ]
Bool IsUpper(Void);

Return value

  • If all the characters in the string are capital, or empty: true
  • Otherwise: false

SFXAnsiString::LastIndexOf
Get the last index of SFXAnsiString object to match a specified data, searching from the end.
[ public, const ]
SInt32 LastIndexOf(
    SFXAnsiStringConstRef string    // string to match
    SInt32 index = SINT32_MAXIMUM   // beginning index to search from
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SInt32 LastIndexOf(
    ACharConstPtr string            // string to match
    SInt32 index = SINT32_MAXIMUM   // beginning index to match
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SInt32 LastIndexOf(
    AChar character                 // character to match
    SInt32 index = SINT32_MAXIMUM   // beginning index to match
    Bool sensitive = true           // case-sensitive or not
);

Return value

  • If succeeds : The last index where found.
  • If failed : -1

Description

To search from other than the end, specify the beginning index to match. (The origin index is 0.)

Reference

SFXAnsiString::FirstIndexOf


SFXAnsiString::Mul
Repeat the string by a specified times.
[ public ]
SFCError Mul(
    SInt32 repeat   // times to repeat
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If insufficient memory : SFERR_NO_MEMOERY

Description

The SFXAnsiString::Mul function updates the source string.

To presereve the source string, copy it somewhere beforehand.

Example

SFXAnsiString str(abc");
str.Mul(3); // str = "abcabcabc"

Reference

SFXAnsiString::Add | SFXAnsiString::Sub | operator* | SFXAnsiString::operator*=


SFXAnsiString::Remove
Remove the characters within a specified range.
[ public, const ]
SFXAnsiString Remove(
    SInt32 begin   // beginning index(this index is included)
    SInt32 end     // ending index(this index is not included)
);

Reference

SFXAnsiString::Insert


SFXAnsiString::Replace
Replace the string.
[ public, const ]
SFXAnsiString Replace(
    SFXAnsiStringConstRef fstring   // string to be replaced
    SFXAnsiStringConstRef tstring   // string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    SFXAnsiStringConstRef fstring   // string to be replaced
    ACharConstPtr tstring           // string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    SFXAnsiStringConstRef fstring   // string to be replaced
    ACharConstPtr tstring           // string to replace with
    SInt32 tlength                  // length of string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring           // string to be replaced
    SFXAnsiStringConstRef tstring   // string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring           // string to be replaced
    SInt32 flength                  // length of string to be replaced
    SFXAnsiStringConstRef tstring   // string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring   // string to be replaced
    ACharConstPtr tstring   // string to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring   // string to be replaced
    SInt32 flength          // length of string to be replaced
    ACharConstPtr tstring   // string to replace with
    SInt32 tlength          // length of string to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    SFXAnsiStringConstRef fstring   // string to be replaced
    AChar tcharacter                // character to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    AChar fcharacter                // character to be replaced
    SFXAnsiStringConstRef tstring   // string to replace with
    Bool sensitive = true           // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    AChar fcharacter        // character to be replaced
    AChar tcharacter        // character to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring   // string to be replaced
    AChar tcharacter        // character to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    ACharConstPtr fstring   // string to be replaced
    SInt32 flength          // length of string to be replaced
    AChar tcharacter        // character to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    AChar fcharacter        // character to be replaced
    ACharConstPtr tstring   // string to replace with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Replace(
    AChar fcharacter        // character to be replaced
    ACharConstPtr tstring   // string to replace with
    SInt32 tlength          // length of string to replace with
    Bool sensitive = true   // case-sensitive or not
);

Return value

Return the replaced string.

Description

The source string is not modified.


SFXAnsiString::Set
Set the string.
[ public ]
SFCError Set(
    SFXAnsiStringConstRef string   // source string of AChar type
);
[ public ]
SFCError Set(
    SFXWideStringConstRef string   // source string of WChar type
);
[ public ]
SFCError Set(
    ACharConstPtr string   // AChar pointer of source string
    SInt32 length = -1     // length of string
);
[ public ]
SFCError Set(
    WCharConstPtr string   // WChar pointer of source string
    SInt32 length = -1     // length of string
);
[ public ]
SFCError Set(
    AChar character   // AChar character of source string
);
[ public ]
SFCError Set(
    SFXBufferConstRef buffer   // buffer of source string
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If insufficient memory : SFERR_NO_MEMORY

In case the SFXAnsiString::Set function fails due to insufficient memory, the source string value is not modified.

Description

If the SFXAnsiString or SFXWideString object is specified as an argument, its string is set.

If the pointer to the AChar or WChar string is specified as an argument, the null-terminated string is set. And moreover by specifying the length as an argument, a string including several "null" characters can be set.

Reference

SFXAnsiString::SFXAnsiString | SFXAnsiString::operator=


SFXAnsiString::SetChar
Set a character at a specified index.
[ public ]
SFCError SetChar(
    SInt32 index      // index where a character is set
    AChar character   // character to set
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If a specified index is invalid : SFERR_INVALID_PARAM
  • If insufficient memory : SFERR_NO_MEMORY

Description

Set a character at a specified index of internal buffer.

Whether a specified index is valid or the buffer is null is not checked.

Reference

SFXAnsiString::GetBuffer | SFXAnsiString::GetChar


SFXAnsiString::SetCluster
Set the cluster size of the internal buffer memory. [in bytes]
[ public ]
Void SetCluster(
    UInt16 size   // cluster size to set
);

Description

This function sets the minimum unit to allocate the internal buffer memory(SFXClusterHeap). [in bytes]

Default: SFXAnsiString::DEFAULT_CLUSTER bytes

For the value of SFXAnsiString::DEFAULT_CLUSTER, refer to SFXAnsiString::DefaultEnum.

Reference

SFXAnsiString::GetCluster | SFXAnsiString::DefaultEnum | SFXClusterHeap::SetCluster | SFXClusterHeap


SFXAnsiString::SetLength
Set the length of string.
[ public ]
SFCError SetLength(
    SInt32 length   // length to set
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If insufficient memory : SFERR_NO_MEMORY

Description

If a specified length is shorter than the string, the string characters after a specified length are lost. If a specified length is longer than the string, the string is extended with a null character.

Reference

SFXAnsiString::GetLength | SFXAnsiString::GetLengthCString


SFXAnsiString::SetThreshold
Set the minimum size of the internal buffer memory. [in bytes]
[ public ]
Void SetThreshold(
    UInt16 size   // minimum value to set
);

Description

This function sets the minimum memory of the internal buffer memory(SFXClusterHeap). [in bytes]

Default: SFXAnsiString::DEFAULT_THRESHOLD bytes

For the value of SFXAnsiString::DEFAULT_THRESHOLD, refer to SFXAnsiString::DefaultEnum.

Reference

SFXAnsiString::GetThreshold | SFXAnsiString::DefaultEnum | SFXClusterHeap::SetThreshold | SFXClusterHeap


SFXAnsiString::StartsWith
Check whether the string starts with a specified string or not.
[ public, const ]
Bool StartsWith(
    SFXAnsiStringConstRef string   // string to check with
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
Bool StartsWith(
    ACharConstPtr string    // string to check with
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
Bool StartsWith(
    AChar character         // character to check with
    Bool sensitive = true   // case-sensitive or not
);

Return value

  • If starts with a specified string: true
  • Otherwise: false

Reference

SFXAnsiString::EndsWith


SFXAnsiString::Sub
Delete a specified string from the end of source string.
[ public ]
SFCError Sub(
    SFXAnsiStringConstRef string   // string to delete
);
[ public ]
SFCError Sub(
    ACharConstPtr string   // string to delete
    SInt32 length = -1     // length of string
);
[ public ]
SFCError Sub(
    AChar character   // character to delete
);

Return value

  • If succeeds : SFERR_NO_ERROR
  • If insufficient memory : SFERR_NO_MEMORY

Description

If the source string ends with a specified string, delete a specified string from the source string. Otherwise, nothing happens.

The SFXAnsiString::Sub function modifies the source string. To preserve the source string, use the operator "-".

Reference

SFXAnsiString::operator-= | operator+


SFXAnsiString::Substring
Get the sub-string from the source string.
[ public, const ]
SFXAnsiString Substring(
    SInt32 begin   // beginning index(this index is included)
    SInt32 end     // ending index(this index is not included)
);

Description

Return the string from the ("begin" + 1)th character to the ("end")th character. Its length is (end - begin).

The SFXAnsiString::Substring function does not modify the source string.

If the value of "begin" is greater than that of "end", the "null" string is returned.

Example

SFXAnsiString str1("American");
SFXAnsiString str2 = str1.Substring(2, 6);  // str2 = "eric"

SFXAnsiString::ToLower
Convert the string into lower characters.
[ public ]
Void ToLower(Void);

Description

The SFXAnsiString::ToLower function modifies the source string.

To preserve the source string, use the SFXAnsiString::AsLower function.

Reference

SFXAnsiString::ToUpper | SFXAnsiString::AsLower


SFXAnsiString::ToUpper
Convert the string into capital characters.
[ public ]
Void ToUpper(Void);

Description

The SFXAnsiString::ToUpper function modifies the source string.

To preserve the source string, use the SFXAnsiString::AsUpper function.

Reference

SFXAnsiString::ToLower | SFXAnsiString::AsUpper


SFXAnsiString::Trim
Trim the blank characters or a specified string/character from the beginning and end of source string.
[ public, const ]
SFXAnsiString Trim(
    SFXAnsiStringConstRef string   // string to trim
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
SFXAnsiString Trim(
    ACharConstPtr string    // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Trim(
    AChar character         // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString Trim(Void);

Description

When no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) are trimmed from the beginning and end of source string.

When an argument is specified, a specified string/character is trimmed from the beginning and end of source string. If a specified string includes more than two characters, each character is compared with one by one.

The source string is not modified.

Example

SFXAnsiString str1("\t delicious beef ");
SFXAnsiString str2 = str1.Trim();        // str2 = "delicious beef"
SFXAnsiString str3 = str2.Trim("adef");  // str3 = "licious b"

Reference

SFXAnsiString::TrimLeft | SFXAnsiString::TrimRight


SFXAnsiString::TrimLeft
Trim the blank characters or a specified string/character from the beginning of source string.
[ public, const ]
SFXAnsiString TrimLeft(
    SFXAnsiStringConstRef string   // string to trim
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimLeft(
    ACharConstPtr string    // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimLeft(
    AChar character         // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimLeft(Void);

Description

When no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) are trimmed from the beginning of source string.

When an argument is specified, a specified string/character is trimmed from the beginning of source string. If a specified string includes more than two characters, each character is compared with one by one.

The source string is not modified.

Example

SFXAnsiString str1("\t delicious beef ");
SFXAnsiString str2 = str1.TrimLeft();        // str2 = "delicious beef "
SFXAnsiString str3 = str2.TrimLeft("adef");  // str3 = "licious beef "

Reference

SFXAnsiString::Trim | SFXAnsiString::TrimRight


SFXAnsiString::TrimRight
Trim the blank characters or a specified string/character from the end of source string.
[ public, const ]
SFXAnsiString TrimRight(
    SFXAnsiStringConstRef string   // string to trim
    Bool sensitive = true          // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimRight(
    ACharConstPtr string    // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimRight(
    AChar character         // string to trim
    Bool sensitive = true   // case-sensitive or not
);
[ public, const ]
SFXAnsiString TrimRight(Void);

Description

When no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) are trimmed from the end of source string.

When an argument is specified, a specified string/character is trimmed from the end of source string. If a specified string includes more than two characters, each character is compared with one by one.

The source string is not modified.

Example

SFXAnsiString str1("\t delicious beef ");
SFXAnsiString str2 = str1.TrimRight();        // str2 = "\t delicious beef"
SFXAnsiString str3 = str2.TrimRight("adef");  // str3 = "\t delicious b"

Reference

SFXAnsiString::Trim | SFXAnsiString::TrimLeft


SFXAnsiString::Truncate
Get the string until the first "null" character.
[ public, const ]
SFXAnsiString Truncate(Void);

Example

SFXAnsiString str1("abc\0abc", 7);
SFXAnsiString str2 = str1.Truncate(); // str2 = "abc"

SFXAnsiString::operator=
Substitute the string with a specified string.
[ public ]
SFXAnsiStringRef operator=(
    SFXAnsiStringConstRef string   // source string of AChar type
);
[ public ]
SFXAnsiStringRef operator=(
    SFXWideStringConstRef string   // source string of WChar type
);
[ public ]
SFXAnsiStringRef operator=(
    ACharConstPtr string   // AChar pointer of source string
);
[ public ]
SFXAnsiStringRef operator=(
    WCharConstPtr string   // WChar pointer of source string
);

Description

If a SFXWideString or SFXWideString object is specified, the string will be replaced with it.

If a pointer to the AChar or WChar, the string will be replaced with the null-terminated string shown by the pointer.

Reference

SFXAnsiString::SFXAnsiString | SFXAnsiString::Set


operator==
Check the "=" relation.
[ public, friend ]
Bool operator==(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator==(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator==(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator==(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator==(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator==(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • If left equals right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | SFXAnsiString::Equals


operator>=
Check the ">=" relation.
[ public, friend ]
Bool operator>=(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>=(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>=(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator>=(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator>=(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>=(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • left equals or is greater than right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | operator> | operator< | operator<=


operator>
Check the ">" relation.
[ public, friend ]
Bool operator>(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator>(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator>(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator>(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • If left is greater than right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | operator>= | operator< | operator<=


SFXAnsiString::operator[]
Get the character at a specified index.
[ public ]
ACharRef operator[](
    SInt32 index   // index position of string to get
);
[ public, const ]
ACharConstRef operator[](
    SInt32 index   // index position of string to get
);

Description

Get the character of intenal buffer at a specified index.

Whether the buffer is null or a specified index value is valid is not checked.

Reference

SFXAnsiString::GetChar


SFXAnsiString::operator<<
Append a string on the end of string.
[ public, friend ]
SFXAnsiStringRef operator<<(
    SFXAnsiStringRef left         // target string
    SFXAnsiStringConstRef right   // string to append
);
[ public, friend ]
SFXAnsiStringRef operator<<(
    SFXAnsiStringRef left         // target string
    SFXWideStringConstRef right   // string to append
);
[ public, friend ]
SFXAnsiStringRef operator<<(
    SFXAnsiStringRef left   // target string
    ACharConstPtr right     // string to append
);
[ public, friend ]
SFXAnsiStringRef operator<<(
    SFXAnsiStringRef left   // target string
    WCharConstPtr right     // string to append
);
[ public, friend ]
SFXAnsiStringRef operator<<(
    SFXAnsiStringRef left   // target string
    AChar right             // string to append
);

Description

Append a specified string onto the end of string.

To combine several strings fast, use the inserter operator<<.

The operator<< updates the source string.

Example

SFXAnsiString str = "abc";
str << "def" << "ghi"; // str = "abcdefghi"

Reference

SFXAnsiString::Add


operator<=
Check the "<=" relation.
[ public, friend ]
Bool operator<=(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<=(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<=(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator<=(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator<=(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<=(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • If left equals or is less than right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | operator> | operator>= | operator<


operator<
Check the "<" relation.
[ public, friend ]
Bool operator<(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator<(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator<(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator<(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • If left is less than right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | operator> | operator>= | operator<=


SFXAnsiString::operator-=
Delete a specified string from the end of source string.
[ public ]
SFXAnsiStringRef operator-=(
    SFXAnsiStringConstRef string   // string to delete from the end
);
[ public ]
SFXAnsiStringRef operator-=(
    ACharConstPtr string   // string to delete from the end
);
[ public ]
SFXAnsiStringRef operator-=(
    AChar character   // character to delete from the end
);

Description

If the string to delete exists , delete it.

If the string to delete does not exist , do nothing.

Reference

SFXAnsiString::Sub | operator+ | SFXAnsiString::operator+= | operator- | operator* | SFXAnsiString::operator*=


operator-
Delete a specified string from the end of left-hand string.
[ public, friend ]
SFXAnsiString operator-(
    SFXAnsiStringConstRef left    // target string
    SFXAnsiStringConstRef right   // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    SFXAnsiStringConstRef left    // target string
    SFXWideStringConstRef right   // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    SFXAnsiStringConstRef left   // target string
    ACharConstPtr right          // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    SFXAnsiStringConstRef left   // target string
    WCharConstPtr right          // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    ACharConstPtr left            // target string
    SFXAnsiStringConstRef right   // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    WCharConstPtr left            // target string
    SFXAnsiStringConstRef right   // string to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    SFXAnsiStringConstRef left   // target string
    AChar right                  // character to delete from the end
);
[ public, friend ]
SFXAnsiString operator-(
    AChar left                    // target Character
    SFXAnsiStringConstRef right   // string to delete from the end
);

Description

If the string to delete exists in the end of the target string, delete it and return the remained string.

If the string to delete does not exist in the end of the target string, do nothing, just copy it and return it.

Example

SFXAnsiString str1("Hello World");
SFXAnsiString str2(" World");
SFXAnsiString str3 = str1 - str2;   // str3 = "Hello"

Reference

SFXAnsiString::Sub | operator+ | SFXAnsiString::operator+= | SFXAnsiString::operator-= | operator* | SFXAnsiString::operator*=


SFXAnsiString::operator*=
Repeat the string by a specified times.
[ public ]
SFXAnsiStringRef operator*=(
    SInt32 repeat   // times to repeat
);

Reference

SFXAnsiString::Mul | operator+ | SFXAnsiString::operator+= | operator- | SFXAnsiString::operator-= | operator*


operator*
Repeat the string by a specified times.
[ public, friend ]
SFXAnsiString operator*(
    SFXAnsiStringConstRef left   // string to repeat
    SInt32 right                 // times to repeat
);

Reference

SFXAnsiString::Mul | operator+ | SFXAnsiString::operator+= | operator- | SFXAnsiString::operator-= | SFXAnsiString::operator*=


operator!=
Check the "!=" relation.
[ public, friend ]
Bool operator!=(
    SFXAnsiStringConstRef left    // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator!=(
    SFXAnsiStringConstRef left    // string to compare
    SFXWideStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator!=(
    SFXAnsiStringConstRef left   // string to compare
    ACharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator!=(
    SFXAnsiStringConstRef left   // string to compare
    WCharConstPtr right          // string to compare
);
[ public, friend ]
Bool operator!=(
    ACharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);
[ public, friend ]
Bool operator!=(
    WCharConstPtr left            // string to compare
    SFXAnsiStringConstRef right   // string to compare
);

Return value

  • If left does not equal right: true
  • Otherwise: false

Reference

SFXAnsiString::Compare | SFXAnsiString::Equals | operator==


SFXAnsiString::operator+=
Add string.
[ public ]
SFXAnsiStringRef operator+=(
    SFXAnsiStringConstRef string   // string to add
);
[ public ]
SFXAnsiStringRef operator+=(
    ACharConstPtr string   // string to add
);
[ public ]
SFXAnsiStringRef operator+=(
    AChar character   // 追加する文字
);

Reference

SFXAnsiString::Add | SFXAnsiString::Concat | operator+


operator+
Add string.
[ public, friend ]
SFXAnsiString operator+(
    SFXAnsiStringConstRef left    // source string
    SFXAnsiStringConstRef right   // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    SFXAnsiStringConstRef left    // source string
    SFXWideStringConstRef right   // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    SFXAnsiStringConstRef left   // source string
    ACharConstPtr right          // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    SFXAnsiStringConstRef left   // source string
    WCharConstPtr right          // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    ACharConstPtr left            // source string
    SFXAnsiStringConstRef right   // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    WCharConstPtr left            // source string
    SFXAnsiStringConstRef right   // string to add
);
[ public, friend ]
SFXAnsiString operator+(
    SFXAnsiStringConstRef left   // source string
    AChar right                  // character to add
);
[ public, friend ]
SFXAnsiString operator+(
    AChar left                    // source character
    SFXAnsiStringConstRef right   // character to add
);

Reference

SFXAnsiString::Add | SFXAnsiString::Concat | SFXAnsiString::operator+=


SFXAnsiString::DefaultEnum
Constants that represent the default values for the minimum size and the cluster size of the internal buffer memory. [in bytes]
enum DefaultEnum {
    DEFAULT_THRESHOLD = 4 * sizeof(AChar),     // default minimum size of the internal buffer memory [in bytes]
    DEFAULT_CLUSTER   = 8 * sizeof(AChar)      // default cluster size to allocate the internal buffer memory [in bytes]
};

Description

DEFAULT_THRESHOLD and DEFAULT_CLUSTER are the constants that represent the default values for the minimum size and the cluster size of the internal buffer memory(SFXClusterHeap). [in bytes]

Reference

SFXAnsiString::SetCluster | SFXAnsiString::SetThreshold | SFXClusterHeap