PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXAnsiString
Class which represents a string of the 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: one is the char type that represents the single/multi byte character(or the ANSI character) and the other is the AECHAR type that represents the double byte character of the uint16 type.

In SophiaFramewok UNIVERSE, these two kinds of character types are defined as AChar and WChar using typedef respectively. And two kinds of the following string classes are available:

All the functions of these two string classes are the same except their string types.

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 801. 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 802. 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 | Character Type

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 this string.
SFCError Add( ACharConstPtr string , SInt32 length = -1 )
Add the specified string to the end of this string.
SFCError Add( AChar character )
Add the specified string to the end of this string.
SFXAnsiString AsLower( Void )
Get this string converted to lower case.
SInt32 AsSInt32( SInt32 substitute = 0 )
Convert this string into the integer of the SInt32 type.
UInt32 AsUInt32( UInt32 substitute = 0 )
Convert this string into the integer of the UInt32 type.
SFXAnsiString AsUpper( Void )
Get this string converted to upper case.
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 this string.
SInt32 Compare( SFXAnsiStringConstRef string , Bool sensitive = true )
Compare this string with the specified string in dictionary order.
SInt32 Compare( ACharConstPtr string , Bool sensitive = true )
Compare this string with the specified string in dictionary order.
SFXAnsiString Concat( SFXAnsiStringConstRef string )
Get the string obtained by concatenating this string and the specified string.
SFXAnsiString Concat( ACharConstPtr string , SInt32 length = -1 )
Get the string obtained by concatenating this string and the specified string.
SFXAnsiString Concat( AChar character )
Get the string obtained by concatenating this string and the specified string.
SFCError Copy( SInt32 index , SFXAnsiStringConstRef string )
Overwrite with the specified string.
SFCError Copy( SInt32 index , ACharConstPtr string , SInt32 length = -1 )
Overwrite with the 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 the empty string.
Bool EndsWith( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether or not this string ends with the specified string.
Bool EndsWith( ACharConstPtr string , Bool sensitive = true )
Check whether or not this string ends with the specified string.
Bool EndsWith( AChar character , Bool sensitive = true )
Check whether or not this string ends with the specified string.
Bool Equals( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether or not this string equals the specified string.
Bool Equals( ACharConstPtr string , Bool sensitive = true )
Check whether or not this string equals the specified string.
Void Fill( AChar character )
Fill this string with the specified character.
SInt32 FirstIndexOf( SFXAnsiStringConstRef string , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of this string to match the specified value, searching from the beginning.
SInt32 FirstIndexOf( ACharConstPtr string , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of this string to match the specified value, searching from the beginning.
SInt32 FirstIndexOf( AChar character , SInt32 index = SINT32_MINIMUM , Bool sensitive = true )
Get the first index of this string to match the specified value, searching from the beginning.
static
SFXAnsiString
Format( va_ref< SFXAnsiStringConst > format , ... )
Create a string from the specified data by using the specified format.
static
SFXAnsiString
Format( va_ref< SFXWideStringConst > format , ... )
Create a string from the specified data by using the specified format.
static
SFXAnsiString
Format( ACharConstPtr format , ... )
Create a string from the specified data by using the specified format.
static
SFXAnsiString
Format( WCharConstPtr format , ... )
Create a string from the specified data by using the specified format.
static
SFXAnsiString
FormatV( SFXAnsiStringConstRef format , va_list argument )
Create a string from the variable-length argument by using the specified format.
static
SFXAnsiString
FormatV( SFXWideStringConstRef format , va_list argument )
Create a string from the variable-length argument by using the specified format.
static
SFXAnsiString
FormatV( ACharConstPtr format , va_list argument )
Create a string from the variable-length argument by using the specified format.
static
SFXAnsiString
FormatV( WCharConstPtr format , va_list argument )
Create a string from the variable-length argument by using the specified format.
ACharPtr GetBuffer( Void )
Get the pointer to the internal buffer of this string.
ACharConstPtr GetBuffer( Void )
Get the pointer to the internal buffer of this string.
ACharConstPtr GetCString( Void )
Get the const pointer to the internal buffer of this string.
AChar GetChar( SInt32 index )
Get the character at the specified index of this string.
UInt16 GetCluster( Void )
Get the cluster size of the internal buffer memory of this string. [in bytes]
SInt32 GetLength( Void )
Get the length(number of the characters) of this string.
SInt32 GetLengthCString( Void )
Get the length(number of the characters) until the first "\0" character of this string.
UInt16 GetThreshold( Void )
Get the minimum size of the internal buffer memory of this string. [in bytes]
SFXAnsiString Insert( SInt32 index , SFXAnsiStringConstRef string )
Get the string obtained by inserting the specified string or character at the specified index of this string.
SFXAnsiString Insert( SInt32 index , ACharConstPtr string , SInt32 length = -1 )
Get the string obtained by inserting the specified string or character at the specified index of this string.
SFXAnsiString Insert( SInt32 index , AChar character )
Get the string obtained by inserting the specified string or character at the specified index of this string.
Bool IsAlpha( Void )
Check whether or not all the characters of this string are alphabetic.
Bool IsAlphaDigit( Void )
Check whether or not all the characters of this string are alphanumeric.
Bool IsAscii( Void )
Check whether or not all the characters of this string are ASCII.
Bool IsControl( Void )
Check whether or not all the characters of this string are the control characters.
Bool IsDigit( Void )
Check whether or not all the characters of this string are digit.
Bool IsEmpty( Void )
Check whether or not the length of this string is 0(this string is empty).
Bool IsEmptyCString( Void )
Check whether or not the first character of this string is null('\0').
Bool IsGraph( Void )
Check whether or not all the characters of this string are graphic.
Bool IsHexDigit( Void )
Check whether or not all the characters of this string are Hex digit.
Bool IsLower( Void )
Check whether or not all the characters of this string are lower-case.
Bool IsNull( Void )
Check whether or not all the characters of this string are null('\0').
Bool IsPrint( Void )
Check whether or not all the characters of this string are printable.
Bool IsPunct( Void )
Check whether or not all the characters of this string are not space nor alphanumeric but printable.
Bool IsSpace( Void )
Check whether or not all the characters of this string are space.
Bool IsUpper( Void )
Check whether or not all the characters of this string are upper-case.
SInt32 LastIndexOf( SFXAnsiStringConstRef string , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of this string to match the specified value, searching from the end.
SInt32 LastIndexOf( ACharConstPtr string , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of this string to match the specified value, searching from the end.
SInt32 LastIndexOf( AChar character , SInt32 index = SINT32_MAXIMUM , Bool sensitive = true )
Get the last index of this string to match the specified value, searching from the end.
SFCError Mul( SInt32 repeat )
Make this string repeated by the specified times.
SFXAnsiString Remove( SInt32 begin , SInt32 end )
Get the string obtained by removing characters in the specified range from this string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , ACharConstPtr tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , ACharConstPtr tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( SFXAnsiStringConstRef fstring , AChar tcharacter , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( AChar fcharacter , SFXAnsiStringConstRef tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( AChar fcharacter , AChar tcharacter , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , AChar tcharacter , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( ACharConstPtr fstring , SInt32 flength , AChar tcharacter , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( AChar fcharacter , ACharConstPtr tstring , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFXAnsiString Replace( AChar fcharacter , ACharConstPtr tstring , SInt32 tlength , Bool sensitive = true )
Get the string obtained by replacing the specified substring in this string with the specified string.
SFCError Set( SFXAnsiStringConstRef string )
Set this string to the specified string, character, or buffer.
SFCError Set( SFXWideStringConstRef string )
Set this string to the specified string, character, or buffer.
SFCError Set( ACharConstPtr string , SInt32 length = -1 )
Set this string to the specified string, character, or buffer.
SFCError Set( WCharConstPtr string , SInt32 length = -1 )
Set this string to the specified string, character, or buffer.
SFCError Set( AChar character )
Set this string to the specified string, character, or buffer.
SFCError Set( SFXBufferConstRef buffer )
Set this string to the specified string, character, or buffer.
SFCError SetChar( SInt32 index , AChar character )
Set the specified character at the specified index of this string.
Void SetCluster( UInt16 size )
Set the cluster size of the internal buffer memory of this string. [in bytes]
SFCError SetLength( SInt32 length )
Set the length of this string.
Void SetThreshold( UInt16 size )
Set the minimum size of the internal buffer memory of this string. [in bytes]
Bool StartsWith( SFXAnsiStringConstRef string , Bool sensitive = true )
Check whether or not this string starts with the specified string.
Bool StartsWith( ACharConstPtr string , Bool sensitive = true )
Check whether or not this string starts with the specified string.
Bool StartsWith( AChar character , Bool sensitive = true )
Check whether or not this string starts with the specified string.
SFCError Sub( SFXAnsiStringConstRef string )
Delete the specified string at the end of this string.
SFCError Sub( ACharConstPtr string , SInt32 length = -1 )
Delete the specified string at the end of this string.
SFCError Sub( AChar character )
Delete the specified string at the end of this string.
SFXAnsiString Substring( SInt32 begin , SInt32 end )
Get the sub-string in the specified range of this string.
Void ToLower( Void )
Convert this string to lower-case.
Void ToUpper( Void )
Convert this string to upper-case.
SFXAnsiString Trim( SFXAnsiStringConstRef string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head and tail of this string.
SFXAnsiString Trim( ACharConstPtr string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head and tail of this string.
SFXAnsiString Trim( AChar character , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head and tail of this string.
SFXAnsiString Trim( Void )
Get the string obtained by trimming the blank characters or the specified string/character from the head and tail of this string.
SFXAnsiString TrimLeft( SFXAnsiStringConstRef string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head of this string.
SFXAnsiString TrimLeft( ACharConstPtr string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head of this string.
SFXAnsiString TrimLeft( AChar character , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the head of this string.
SFXAnsiString TrimLeft( Void )
Get the string obtained by trimming the blank characters or the specified string/character from the head of this string.
SFXAnsiString TrimRight( SFXAnsiStringConstRef string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the tail of this string.
SFXAnsiString TrimRight( ACharConstPtr string , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the tail of this string.
SFXAnsiString TrimRight( AChar character , Bool sensitive = true )
Get the string obtained by trimming the blank characters or the specified string/character from the tail of this string.
SFXAnsiString TrimRight( Void )
Get the string obtained by trimming the blank characters or the specified string/character from the tail of this string.
SFXAnsiString Truncate( Void )
Get the string until the first null('\0') character of this string.
SFXAnsiStringRef operator*=( SInt32 repeat )
Repeat the left-hand string by the right-hand times.
SFXAnsiStringRef operator+=( SFXAnsiStringConstRef string )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator+=( ACharConstPtr string )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator+=( AChar character )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator-=( SFXAnsiStringConstRef string )
Delete the right-hand string from the end of the left-hand string.
SFXAnsiStringRef operator-=( ACharConstPtr string )
Delete the right-hand string from the end of the left-hand string.
SFXAnsiStringRef operator-=( AChar character )
Delete the right-hand string from the end of the left-hand string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , SFXAnsiStringConstRef right )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , SFXWideStringConstRef right )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , ACharConstPtr right )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , WCharConstPtr right )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator<<( SFXAnsiStringRef left , AChar right )
Add the right-hand string to the end of the left-hand string.
SFXAnsiStringRef operator=( SFXAnsiStringConstRef string )
Assign the right-hand string to the left-hand string.
SFXAnsiStringRef operator=( SFXWideStringConstRef string )
Assign the right-hand string to the left-hand string.
SFXAnsiStringRef operator=( ACharConstPtr string )
Assign the right-hand string to the left-hand string.
SFXAnsiStringRef operator=( WCharConstPtr string )
Assign the right-hand string to the left-hand string.
ACharRef operator[]( SInt32 index )
Get the character at the right-hand index of the left-hand string.
ACharConstRef operator[]( SInt32 index )
Get the character at the right-hand index of the left-hand string.
Bool operator==( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , ACharConstPtr right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , WCharConstPtr right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( ACharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( WCharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , AChar right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( AChar left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator*( SFXAnsiStringConstRef left , SInt32 right )
Return the string obtained by repeating the left-hand string by the right-hand times.
Bool operator!=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , ACharConstPtr right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , WCharConstPtr right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( ACharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( WCharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , AChar right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( AChar left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand 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 whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator==( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is the same with the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than or equals the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator>( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is greater than the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than or equals the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
Bool operator<( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is less than the right-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , ACharConstPtr right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , WCharConstPtr right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( ACharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( WCharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( SFXAnsiStringConstRef left , AChar right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator-( AChar left , SFXAnsiStringConstRef right )
Return the string obtained by deleting the right-hand string from the end of the left-hand string.
SFXAnsiString operator*( SFXAnsiStringConstRef left , SInt32 right )
Return the string obtained by repeating the left-hand string by the right-hand times.
Bool operator!=( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , ACharConstPtr right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( SFXAnsiStringConstRef left , WCharConstPtr right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( ACharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
Bool operator!=( WCharConstPtr left , SFXAnsiStringConstRef right )
Check whether or not the left-hand string is different from the right-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , SFXWideStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , ACharConstPtr right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , WCharConstPtr right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( ACharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( WCharConstPtr left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( SFXAnsiStringConstRef left , AChar right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.
SFXAnsiString operator+( AChar left , SFXAnsiStringConstRef right )
Return the string obtained by adding the right-hand string to the end of the left-hand string.

SFXAnsiString::SFXAnsiString
Constructor of the SFXAnsiString class.
[ public, explicit ]
SFXAnsiString(Void);
[ public ]
SFXAnsiString(
    SFXAnsiStringConstRef string   // SFXAnsiString string to copy
);
[ public ]
SFXAnsiString(
    SFXWideStringConstRef string   // SFXWideString string to copy
);
[ public ]
SFXAnsiString(
    ACharConstPtr string   // pointer to the AChar string to copy
    SInt32 length = -1     // length of the AChar string
);
[ public ]
SFXAnsiString(
    WCharConstPtr string   // pointer to the WChar string to copy
    SInt32 length = -1     // length of the WChar string to copy
);
[ public, explicit ]
SFXAnsiString(
    AChar character   // character to set
);
[ public, explicit ]
SFXAnsiString(
    SFXBufferConstRef buffer   // SFXBuffer buffer to copy
);
[ public, explicit ]
SFXAnsiString(
    UInt16 threshold   // mininum size of the internal buffer memory
    UInt16 cluster     // cluster size of the internal buffer memory
);

Description

If a string, character or buffer is specified in the argument, this constructer will set this string to the specified values by calling the SFXAnsiString::Set function internally.

If the cluster argument and the threshold argument are specified, the cluster size and the mininum size of the internal buffer memory will be set to the specified values by calling the SFXAnsiString::SetCluster function the SFXAnsiString::SetThreshold function internally.

Reference

SFXAnsiString::Set | SFXAnsiString::SetCluster | SFXAnsiString::SetThreshold


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

Description

This destructor releases the internal buffer memory of this string.


SFXAnsiString::Add
Add the specified string to the end of this 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

Description

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

If the pointer to the AChar string is specified as an argument, the specified string will be regarded as the null-terminated string. Moreover, by specifying the length argument, a string including several null('\0') characters can be specified.

[Note] Note

The value that is less than or equals the length of the string specified in the string argument must be specified in the length argument. If a negative value is specified, the length of the null-terminated string specified in the string argument will be assumed to be set.

The default value of the length argument is "-1".

[Tip] Tip
This function influences the content of this 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
Get this string converted to lower case.
[ public, const ]
SFXAnsiString AsLower(Void);

Return value

This string converted to lower case

Description

This function gets this string converted to lower case.

[Note] Note
This string will not be modified after this function is executed.

Reference

SFXAnsiString::AsUpper | SFXAnsiString::ToLower


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

Return value

Integer of the SInt32 type converted from this string

Description

This function converts this string into the integer of the SInt32 type.

The " " chraracter in the head of this string will be ignored. The "+" or "-" character can be permitted to be placed at most once before the numeric string. If omitted, the numeric string will be regarded as the positive integer.

[Tip] Tip
If this conversion fails since characters other than " ", "+", "-", or number are included in this string, the value specified in the substitute argument will be returned.

Reference

SFXAnsiString::AsUInt32


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

Return value

Integer of the UInt32 type converted from this string

Description

This function converts this string into the integer of the UInt32 type.

The " " chraracter in the head of this string will be ignored. The "+" character can be permitted to be placed at most once before the numeric string.

[Tip] Tip
If this conversion fails since characters other than " ", "+", or number are included in this string, the value specified in the substitute argument will be returned. For instance, in case the "-" character appears before the numeric string, this conversion will fail.

Reference

SFXAnsiString::AsSInt32


SFXAnsiString::AsUpper
Get this string converted to upper case.
[ public, const ]
SFXAnsiString AsUpper(Void);

Return value

This string converted to upper case

Description

This function gets this string converted to upper case.

[Note] Note
This string will not be modified after this function is executed.

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 executed, 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 this string.
[ public ]
Void Clear(Void);

Description

This function clears this string.

[Note] Note
The memory area allocated to this string before this function is executed will be released.

SFXAnsiString::Compare
Compare this string with the specified string in 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 this string is less than the specified string : Minus value
  • If this string equals the specified string: 0
  • If this string is greater than the specified string : Positive value

Description

This function compares this string with the specified string in dictionary order.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.

Reference

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


SFXAnsiString::Concat
Get the string obtained by concatenating this string and the specified string.
[ public, const ]
SFXAnsiString Concat(
    SFXAnsiStringConstRef string   // string to concatenate
);
[ public, const ]
SFXAnsiString Concat(
    ACharConstPtr string   // string to concatenate
    SInt32 length = -1     // length of the string
);
[ public, const ]
SFXAnsiString Concat(
    AChar character   // character to concatenate
);

Return value

String obtained by concatenating this string and the specified string.

Description

This function gets the string obtained by concatenating this string and the specified string.

If the pointer to the AChar string is specified as an argument, the specified string will be regarded as the null-terminated string. Moreover, by specifying the length argument, a string including several null('\0') characters can be specified.

[Note] Note

The value that is less than or equals the length of the string specified in the string argument must be specified in the length argument. If a negative value is specified, the length of the null-terminated string specified in the string argument will be assumed to be set.

The default value of the length argument is "-1".

[Tip] Tip
Different from the SFXAnsiString::Add function, this string will not be modified after this function is executed.

Reference

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


SFXAnsiString::Copy
Overwrite with the 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 the end of the copied string exceeds that of this string or the index argument points to out of this string: SFERR_INVALID_PARAM

Description

This function overwrites the specified substring of this string with the specified string.

If the end of the copied string exceeds that of this string or the index argument points to out of this string, SFERR_INVALID_PARAM will be return. This string will not be overwritten.

If the pointer to the AChar string is specified as an argument, the specified string will be regarded as the null-terminated string. Moreover, by specifying the length argument, a string including several null('\0') characters can be specified.

[Note] Note

The value that is less than or equals the length of the string specified in the string argument must be specified in the length argument. If a negative value is specified, the length of the null-terminated string specified in the string argument will be assumed to be set.

The default value of the length argument is "-1".


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 the empty string.
[ public, static ]
SFXAnsiStringConstRef EmptyInstance(Void);

Return value

Empty string

Description

This function gets the empty string.

[Tip] Tip
This function will used to return the reference to the empty string as the return value of a function.

SFXAnsiString::EndsWith
Check whether or not this string ends with the specified string.
[ 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 the specified string: true
  • Otherwise: false

Description

This function checks whether or not this string ends with the specified string.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.

Reference

SFXAnsiString::StartsWith


SFXAnsiString::Equals
Check whether or not this string equals the specified string.
[ 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 this string equals the specified string: true
  • Otherwise: false

Description

This function checks whether or not this string equals the specified string.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.

Reference

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


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

Description

This function fills this string with the specified character.


SFXAnsiString::FirstIndexOf
Get the first index of this string to match the specified value, 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

This function gets the first index of this string to match the specified value, searching from the beginning.

The index argument is used to search from other than the beginning. (The origin index is 0.)

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.

Reference

SFXAnsiString::LastIndexOf


SFXAnsiString::Format
Create a string from the specified data by using the specified 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

This function creates a string from the specified data by using the specified format.

This function is almost the same as the printf function in C language, except that the floating-point format is not available.

[Note] Note
For more details on the format, see BREW API SPRINTF.

Example

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

Reference

BREW API SPRINTF


SFXAnsiString::FormatV
Create a string from the variable-length argument by using the specified format.
[ 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

This function creates a string from the variable-length argument by using the specified format.

This function is almost the same as the printf function in C language, except that the floating-point format is not available.

[Note] Note
For more details on the format, see BREW API SPRINTF.

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 | BREW API SPRINTF


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

Return value

Pointer to the internal buffer of this string.

Description

This function gets the pointer to the internal buffer of this string, through which data can be written into the internal buffer.

If this string is empty, null will be returned.

[Caution] Caution

You should not access the position over the length returned obtained by the SFXAnsiString::GetLength function from the position that the pointer to the internal buffer of this string.

[Note] Difference between the GetBuffer function and the GetCString function

When this string is empty, the SFXAnsiString::GetCString function will return the pointer to "\0", on the other hand, the SFXAnsiString::GetBuffer function will return null.

Since the pointer returned by the SFXAnsiString::GetCString function is of the const type, no data can be written into the internal buffer through this pointer. To write data into the internal buffer, use the SFXAnsiString::GetBuffer function.

Reference

SFXAnsiString::GetCString | SFXAnsiString::GetLength


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

Return value

Pointer of the ACharConstPtr type to the internal buffer of this string

Description

This function gets the pointer of the ACharConstPtr type to the internal buffer of this string, through which data cannot be written into the internal buffer.

If this string is empty, the pointer to "\0" will be returned.

[Note] Difference between the GetBuffer function and the GetCString function

When this string is empty, the SFXAnsiString::GetCString function will return the pointer to "\0", on the other hand, the SFXAnsiString::GetBuffer function will return null.

Since the pointer returned by the SFXAnsiString::GetCString function is of the const type, no data can be written into the internal buffer through this pointer. To write data into the internal buffer, use the SFXAnsiString::GetBuffer function.

Reference

SFXAnsiString::GetBuffer


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

Return value

Character at the specified index of this string. If this string is empty or the specified index is out of range of this string , null('\0') will be returned.

Description

This function gets the character at the specified index of this string.

[Caution] Caution

If this string is empty or the specified index is out of range of this string , null('\0') will be returned.

Reference

SFXAnsiString::GetBuffer | SFXAnsiString::SetChar


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

Return value

Cluster size of the internal buffer memory of this string. [in bytes]

Description

This function gets cluster size of the internal buffer memory of this string. [in bytes]

Reference

SFXAnsiString::SetCluster


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

Return value

Length(number of the characters) of this string.

Description

This function gets the length(number of the characters) of this string.

[Note] Note

If this string includes "\0", "\0" will be counted.

Example

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

Reference

SFXAnsiString::GetLengthCString | SFXAnsiString::SetLength


SFXAnsiString::GetLengthCString
Get the length(number of the characters) until the first "\0" character of this string.
[ public, const ]
SInt32 GetLengthCString(Void);

Return value

Length(number of the characters) until the first "\0" character of this string.

Description

This function gets the length(number of the characters) until the first "\0" character of this string.

[Note] Note

The first "\0" character will not be counted.

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 of this string. [in bytes]
[ public, const ]
UInt16 GetThreshold(Void);

Return value

Minimum size of the internal buffer memory of this string. [in bytes]

Description

This function gets the minimum size of the internal buffer memory of this string. [in bytes]

Reference

SFXAnsiString::SetThreshold


SFXAnsiString::Insert
Get the string obtained by inserting the specified string or character at the specified index of this string.
[ 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
);

Return value

String obtained by inserting the specified string or character at the specified index of this string.

Description

This function gets the string obtained by inserting the specified string or character at the specified index of this string.

If the index argument is less than 0, 0 will be assumed to be specified. And if the index argument is greater than or equals the length of this string, "lenght of this string" will be assumed to be specified.

[Caution] Caution

The content of this string will not be modified by this operation.


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

Return value

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

Description

This function checks whether or not all the characters of this string are alphabetic.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsAlpha


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

Return value

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

Description

This function checks whether or not all the characters of this string are alphanumeric.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsAlphaDigit


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

Return value

  • If all the characters of this string are ASCII, or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are ASCII.

[Note] ASCII character

The code of the ASCII character is greater than or equals 0x00 and less than or equals 0x7F.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsAscii


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

Return value

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

Description

This function checks whether or not all the characters of this string are the control characters.

[Note] Control character

The code of the control character is less than 0x20, or equals 0x7F.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsControl


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

Return value

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

Description

This function checks whether or not all the characters of this string are digit.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsDigit


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

Return value

  • If the length of this string is 0(this string is empty): true
  • Otherwise: false

Description

This function checks whether or not the length of this string is 0(this string is empty).

Example

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

Reference

SFXAnsiString::IsEmptyCString | SFXAnsiString::GetLength


SFXAnsiString::IsEmptyCString
Check whether or not the first character of this string is null('\0').
[ public, const ]
Bool IsEmptyCString(Void);

Return value

  • If the first character is null('\0'): true
  • Otherwise: false

Description

This function checks whether or not the first character of this string is null('\0').

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 or not all the characters of this string are graphic.
[ public, const ]
Bool IsGraph(Void);

Return value

  • If all the characters of this string are graphic, or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are graphic.

[Note] Graphic character

The graphic character is a printable character except the space character( 0x20 ).

The code of the graphic character is greater than 0x20 and less than 0x7E.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsGraph


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

Return value

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

Description

This function checks whether or not all the characters of this string are Hex digit(digit, or a, b, c, d, e, f, A, B, C, D, E, F).

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsHexDigit


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

Return value

  • If all the characters of this string are lower-case, or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are lower-case.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsLower


SFXAnsiString::IsNull
Check whether or not all the characters of this string are null('\0').
[ public, const ]
Bool IsNull(Void);

Return value

  • If all the characters of this string are null('\0'), or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are null('\0').

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsNull


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

Return value

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

Description

This function checks whether or not all the characters of this string are printable.

[Note] Printable character

The printable character is the character that can be displayed.

The code of the printable character is greater than or equals 0x20 and less than 0x7E.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsPrint


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

Return value

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

Description

This function checks whether or not all the characters of this string are not space nor alphanumeric but printable.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsPunct


SFXAnsiString::IsSpace
Check whether or not all the characters of this string are space.
[ public, const ]
Bool IsSpace(Void);

Return value

  • If all the characters of this string are space, or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are space.

[Note] Space character

The code of the space character including tab, line-feed, and carriage return is from 0x09 to 0x0D or 0x20.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsSpace


SFXAnsiString::IsUpper
Check whether or not all the characters of this string are upper-case.
[ public, const ]
Bool IsUpper(Void);

Return value

  • If all the characters of this string are upper-case, or empty: true
  • Otherwise: false

Description

This function checks whether or not all the characters of this string are upper-case.

[Caution] Caution

If this string is empty, true will be returned.

Reference

SFXAscii::IsUpper


SFXAnsiString::LastIndexOf
Get the last index of this string to match the specified value, 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

This function gets the last index of this string to match the specified value, searching from the end.

The index argument is used to search from other than the end. (The origin index is 0.)

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.

Reference

SFXAnsiString::FirstIndexOf


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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY

Description

This function makes this string repeated by the specified times.

This string will be updated after this function is executed. To presereve this string, copy it somewhere beforehand.

Example

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

Reference

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


SFXAnsiString::Remove
Get the string obtained by removing characters in the specified range from this string.
[ public, const ]
SFXAnsiString Remove(
    SInt32 begin   // beginning index(this index is included)
    SInt32 end     // ending index(this index is not included)
);

Return value

String obtained by removing characters in the specified range from this string.

Description

This function gets the string obtained by removing characters in the specified range from this string.

If the begin argument is greater than or equals the end argument, no character will be removed from this string.

If the begin argument is less than 0, 0 will be assumed to be specified. And if the end argument is greater than the length of this string, "the length of this string" will be assumed to be specified.

[Note] Note
This function will not change the content of this string.

Reference

SFXAnsiString::Insert


SFXAnsiString::Replace
Get the string obtained by replacing the specified substring in this string with the specified 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

String obtained by replacing the specified substring in this string with the specified string.

Description

This function gets the string obtained by replacing the specified substring in this string with the specified string.

[Note] Note

The value that is less than or equals the length of the string specified in the fstring / tstring argument must be specified in the flength / tlength argument. If a negative value is specified, the length of the string specified in the fstring / tstring argument will be assumed to be set.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.
[Note] Note
This function will not change the content of this string.

SFXAnsiString::Set
Set this string to the specified string, character, or buffer.
[ 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 the string
);
[ public ]
SFCError Set(
    WCharConstPtr string   // WChar pointer of source string
    SInt32 length = -1     // length of the 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

Description

This function sets this string to the specified string, character, or buffer.

If the SFXAnsiString or SFXWideString instance is specified as an argument, its string value will be copied and set.

If the pointer to the AChar or WChar string is specified as an argument, the specified string will be regarded as the null-terminated string. Moreover, by specifying the length argument, a string including several null('\0') characters can be specified.

[Note] Note

The value that is less than or equals the length of the string specified in the string argument must be specified in the length argument. If a negative value is specified, the length of the null-terminated string specified in the string argument will be assumed to be set.

The default value of the length argument is "-1".

[Note] Note
If this function fails due to insufficient memory, the content of this string will not be modified.

Reference

SFXAnsiString::SFXAnsiString | SFXAnsiString::operator=


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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the specified index is out of range of this string: SFERR_INVALID_PARAM

Description

This function sets the specified character at the specified index of this string.

Concretely, the specified character will be set at the specified index of the internal buffer of this string.

[Note] Note

If the specified index is out of range of the internal buffer of this string or this string is empty, SFERR_INVALID_PARAM will be returned.

Reference

SFXAnsiString::GetBuffer | SFXAnsiString::GetChar


SFXAnsiString::SetCluster
Set the cluster size of the internal buffer memory of this string. [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) of this string to the specified value. [in bytes]

Default: SFXAnsiString::DEFAULT_CLUSTER bytes

For the value of SFXAnsiString::DEFAULT_CLUSTER, see SFXAnsiString::DefaultEnum.

Reference

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


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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets the length of this string to the specified value.

If the specified length is shorter than this string, the characters after the specified length of this string will be lost. On the other hand, if the specified length is longer than this string, this string will be extended with a null('\0') character.

Reference

SFXAnsiString::GetLength | SFXAnsiString::GetLengthCString


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

Description

This function sets the minimum memory of the internal buffer memory(SFXClusterHeap) of this string to the specified value. [in bytes]

Default: SFXAnsiString::DEFAULT_THRESHOLD bytes

For the value of SFXAnsiString::DEFAULT_THRESHOLD, see SFXAnsiString::DefaultEnum.

Reference

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


SFXAnsiString::StartsWith
Check whether or not this string starts with the specified string.
[ 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 the specified string: true
  • Otherwise: false

Description

This function checks whether or not this string starts with the specified string.

Reference

SFXAnsiString::EndsWith


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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function deletes the specified string at the end of this string.

If this string ends with the specified string, the specified string will be deleted from this string. Otherwise, nothing will happen.

If the pointer to the AChar string is specified as an argument, the specified string will be regarded as the null-terminated string. Moreover, by specifying the length argument, a string including several null('\0') characters can be specified.

[Note] Note

The value that is less than or equals the length of the string specified in the string argument must be specified in the length argument. If a negative value is specified, the length of the null-terminated string specified in the string argument will be assumed to be set.

The default value of the length argument is "-1".

[Tip] Tip
This function influences the content of this string. If you want to keep it unmodified, use the operator- operator.

Reference

SFXAnsiString::operator-= | operator- | operator+


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

Return value

Sub-string in the specified range of this string.

Description

This function gets the sub-string in the specified range of this string.

The string from the ("begin" + 1)th character to the ("end")th character will be returned. Its length is (end - begin).

If the begin argument is greater than or equals the end argument, the null string is returned.

If the begin argument is less than 0, 0 will be assumed to be specified. And if the end argument is greater than the length of this string, "the length of this string" will be assumed to be specified.

[Tip] Tip
This string will not be modified after this function is executed.

Example

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

SFXAnsiString::ToLower
Convert this string to lower-case.
[ public ]
Void ToLower(Void);

Description

This function converts this string to lower-case.

[Note] Note

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

Reference

SFXAnsiString::ToUpper | SFXAnsiString::AsLower


SFXAnsiString::ToUpper
Convert this string to upper-case.
[ public ]
Void ToUpper(Void);

Description

This function converts this string to upper-case.

[Note] Note

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

Reference

SFXAnsiString::ToLower | SFXAnsiString::AsUpper


SFXAnsiString::Trim
Get the string obtained by trimming the blank characters or the specified string/character from the head and tail of this 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);

Return value

String obtained by trimming the blank characters or the specified string/character from the head and tail of this string.

Description

This function gets the string obtained by trimming the blank characters or the specified string/character from the head and tail of this string.

If no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) will be trimmed from the head and tail of this string.

If arguments are specified, the specified string/character will be trimmed from the head and tail of this string.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.
[Note] Note
This function will not change the content of this string.

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
Get the string obtained by trimming the blank characters or the specified string/character from the head of this 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);

Return value

String obtained by trimming the blank characters or the specified string/character from the head of this string.

Description

This function gets the string obtained by trimming the blank characters or the specified string/character from the head of this string.

If no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) will be trimmed from the head of this string.

If arguments are specified, the specified string/character will be trimmed from the head of this string.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.
[Note] Note
This function will not change the content of this string.

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
Get the string obtained by trimming the blank characters or the specified string/character from the tail of this 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);

Return value

String obtained by trimming the blank characters or the specified string/character from the tail of this string.

Description

This function gets the string obtained by trimming the blank characters or the specified string/character from the tail of this string.

If no argument is specified, the blank characters(space, tab, vertical tab, linefeed, return, formfeed) will be trimmed from the tail of this string.

If arguments are specified, the specified string/character will be trimmed from the tail of this string.

[Tip] Tip
Case sensitive comparison can be specified in the sensitive argument.
[Note] Note
This function will not change the content of this string.

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('\0') character of this string.
[ public, const ]
SFXAnsiString Truncate(Void);

Return value

String until the first null('\0') character of this string.

[Note] Note
This function will not change the content of this string.

Description

This function gets the string until the first null('\0') character of this string.

Example

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

SFXAnsiString::operator=
Assign the right-hand string to the left-hand 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

This operator assigns the right-hand string to the left-hand string.

If the SFXAnsiString or SFXWideString instance is specified as the right-hand string, it will be copied and assigned.

If the pointer to the AChar or WChar string is specified as the right-hand string, it will be regarded as the null-terminated string.

[Tip] Tip
This operator influences the content of the left-hand string.

Reference

SFXAnsiString::Set | SFXAnsiString::SFXAnsiString


operator==
Check whether or not the left-hand string is the same with the right-hand string.
[ 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 the left-hand string is the same with the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is the same with the right-hand string.

Reference

SFXAnsiString::Equals | operator!=


operator>=
Check whether or not the left-hand string is greater than or equals the right-hand string.
[ 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 the left-hand string is greater than or equals the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is greater than or equals the right-hand string.

Reference

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


operator>
Check whether or not the left-hand string is greater than the right-hand string.
[ 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 the left-hand string is greater than the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is greater than the right-hand string.

Reference

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


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

Description

This operator gets the character at the right-hand index of the left-hand string.

[Caution] Caution

If the left-hand string is empty or the right-hand index is out of range of the left-hand string, null('\0') will be returned.

Reference

SFXAnsiString::GetChar


SFXAnsiString::operator<<
Add the right-hand string to the end of the left-hand 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

This operator adds the right-hand string to the end of the left-hand string.

[Tip] Tip

This operator influences the content of the left-hand string.

This operator is very useful to concatenate multiple strings.

Example

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

Reference

SFXAnsiString::Add | SFXAnsiString::operator+=


operator<=
Check whether or not the left-hand string is less than or equals the right-hand string.
[ 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 the left-hand string is less than or equals the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is less than or equals the right-hand string.

Reference

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


operator<
Check whether or not the left-hand string is less than the right-hand string.
[ 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 the left-hand string is less than the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is less than the right-hand string.

Reference

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


SFXAnsiString::operator-=
Delete the right-hand string from the end of the left-hand 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

This operator deletes the right-hand string from the end of the left-hand string.

If the right-hand string exists at the end of the left-hand string, the right-hand string will be deleted from the end of the left-hand string.

Otherwise, nothing will happen.

[Tip] Tip
This operator influences the content of the left-hand string.

Reference

SFXAnsiString::Sub operator-


operator-
Return the string obtained by deleting the right-hand string from the end of the 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

This operator returns the string obtained by deleting the right-hand string from the end of the left-hand string.

If the right-hand string exists at the end of the left-hand string, the string by deleting the right-hand string from the end of the left-hand string will be returned.

Otherwise, the left-hand string at it is will be returned.

Example

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

Reference

SFXAnsiString::Sub SFXAnsiString::operator-=


SFXAnsiString::operator*=
Repeat the left-hand string by the right-hand times.
[ public ]
SFXAnsiStringRef operator*=(
    SInt32 repeat   // times to repeat
);

Description

This operator repeats the left-hand string by the right-hand times.

[Tip] Tip
This operator influences the content of the left-hand string.

Reference

SFXAnsiString::Mul | operator*


operator*
Return the string obtained by repeating the left-hand string by the right-hand times.
[ public, friend ]
SFXAnsiString operator*(
    SFXAnsiStringConstRef left   // string to repeat
    SInt32 right                 // times to repeat
);

Description

This operator returns the string obtained by repeating the left-hand string by the right-hand times.

Reference

SFXAnsiString::Mul | SFXAnsiString::operator*=


operator!=
Check whether or not the left-hand string is different from the right-hand string.
[ 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 the left-hand string is different from the right-hand string: true
  • Otherwise: false

Description

This operator checks whether or not the left-hand string is different from the right-hand string.

Reference

SFXAnsiString::Equals | operator==


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

Description

This operator adds the right-hand string to the end of the left-hand string.

[Tip] Tip
This operator influences the content of the left-hand string.

Reference

SFXAnsiString::Add | operator+ | SFXAnsiString::operator<<


operator+
Return the string obtained by adding the right-hand string to the end of the left-hand 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
);

Description

This operator returns the string obtained by adding the right-hand string to the end of the left-hand string.

Reference

SFXAnsiString::Add | 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