Inheritance diagram for CP_String:
Assignment | |
CP_String & | operator= (char inChar) |
CP_String & | operator= (CPUniChar inChar) |
CP_String & | operator= (const char *inString) |
CP_String & | operator= (const CPUniChar *inString) |
CP_String & | operator= (const CP_String &inString) |
CP_String & | assign (char inChar, const CP_TextEncoder *inTextEncoder=NULL) |
CP_String & | assign (CPUniChar inChar) |
CP_String & | assign (UInt32 inCount, char inChar, const CP_TextEncoder *inTextEncoder=NULL) |
CP_String & | assign (UInt32 inCount, CPUniChar inChar) |
CP_String & | assign (const char *inString, const CP_TextEncoder *inTextEncoder=NULL) |
CP_String & | assign (const char *inString, UInt32 inLength, const CP_TextEncoder *inTextEncoder=NULL) |
CP_String & | assign (const CPUniChar *inString) |
CP_String & | assign (const CPUniChar *inString, UInt32 inLength) |
CP_String & | assign (const CP_String &inString, UInt32 inStartIndex=0, UInt32 inLength=npos) |
Conversion | |
CP_String & | operator= (CFStringRef inStringRef) |
CP_String & | operator= (const CP_ResourcePtr< CFStringRef > &inStringRef) |
CP_String & | operator= (CFMutableStringRef inStringRef) |
CP_String & | operator= (const CP_ResourcePtr< CFMutableStringRef > &inStringRef) |
CFStringRef | GetCFStringRef () const |
CFMutableStringRef | GetMutableCFStringRef () |
CP_ResourcePtr< CFStringRef > | GetCFStringRefPtr () const |
CP_ResourcePtr< CFMutableStringRef > | GetMutableCFStringRefPtr () |
Public Types | |
typedef CFStringRef | StringRef |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
enum | { kCP_E_String_BufferSize = 32, npos = MAX_UINT_32 } |
Public Member Functions | |
Constructor / Destructor | |
CP_String () | |
Constructor. | |
CP_String (const char *inCString, const CP_TextEncoder *inTextEncoder=NULL) | |
CP_String (const char *inCString, UInt32 inLength, const CP_TextEncoder *inTextEncoder=NULL) | |
CP_String (UInt32 inCharCount, char inChar, const CP_TextEncoder *inTextEncoder=NULL) | |
CP_String (const CPUniChar *inWString) | |
CP_String (const CPUniChar *inWString, UInt32 inLength) | |
CP_String (UInt32 inCharCount, CPUniChar inChar) | |
CP_String (const unsigned char *inPString, const CP_TextEncoder *inTextEncoder=NULL) | |
CP_String (const std::string &inString, const CP_TextEncoder *inTextEncoder=NULL) | |
CP_String (const std::wstring &inString) | |
CP_String (const CP_String &inString, UInt32 inStartIndex=0, UInt32 inLength=npos) | |
virtual | ~CP_String () |
Destructor. | |
Constructor / Destructor | |
CP_String (CFStringRef inStringRef) | |
Constructor. | |
CP_String (CFMutableStringRef inStringRef) | |
CP_String (const CP_ResourcePtr< CFStringRef > &inStringRef) | |
CP_String (const CP_ResourcePtr< CFMutableStringRef > &inStringRef) | |
Constructor / Destructor | |
CP_String (StringRef inStringRef) | |
Constructor. | |
Static Public Attributes | |
static const CP_String | emptyString |
Protected Member Functions | |
void | AssertUniqueMutableCFStringRef () |
Protected Attributes | |
char * | fCStringDataPtr |
UInt32 | fCStringDataCapacity |
bool | fDirty |
CFStringRef | fImmutableString |
CFMutableStringRef | fMutableString |
CPUniChar * | fStringData |
UInt32 | fStringDataCapacity |
Classes | |
class | __iterator_base |
class | const_iterator |
class | iterator |
class | reference |
Internally all string data is stored as Unicode data, and the class provides converters to convert to non-unicode as well as return the data as a Unicode string.
Under MacOS Carbon we use the CFString data type provided by the MacOS to manage all data.
Under Windows and Linux the data is stored as CPUniChar data.
|
|
|
|
|
|
|
|
|
Constructor. This constructor creates an empty string.
|
|
Constructor. This constructor creates the string from the passed in characters.
|
|
Constructor. This constructor creates the string from the passed in characters.
|
|
Constructor. This constructor creates the string using the passed in char. The char inChar will be repeated inCharCount times in the string.
|
|
Constructor. This constructor creates the string from the passed in UnicodeCharacters.
|
|
Constructor. This constructor creates the string from the passed in CPUniChar string using inLength number of characters from the string.
|
|
Constructor. This constructor creates the string using the passed in Unicode char. The Unicode char inChar will be repeated inCharCount times in the string.
|
|
Constructor. This constructor creates the string from the passed in characters.
|
|
Constructor. This constructor creates the string from the passed in std::string.
|
|
Constructor. This constructor creates the string from the passed in std::string.
|
|
Constructor. This constructor creates the string from a CP_String.
|
|
Destructor. This will also free all memory allocated by this string.
|
|
Constructor from a Carbon CFStringRef string.
|
|
Constructor from a Carbon CFMutableStringRef string.
|
|
Constructor from a Carbon CFStringRef string.
|
|
Constructor from a Carbon CFMutableStringRef string.
|
|
|
|
Creates a string from the given format and parameters. Same as CP_String::StringWithFormatAndArguments, except that the parameters are passed as C-style variable argument list.
|
|
Creates a string from the given format and parameter list.
|
|
Returns a pointer to the first character of the string and the end of the string is NULL terminated.
|
|
Returns a pointer to the first character of the string and the end of the string is NULL terminated. The characters returns are Unicode characters.
|
|
Returns a pointer to a buffer or characters that contains a UTF-8 encoded representation of the string.
|
|
Returns the Unicode character at the passed in 0 based index. Const version.
|
|
|
|
Returns the Unicode character at the passed in 0 (zero) based index. Const version.
|
|
|
|
Returns the first character in our string as a Unicode character. Const version.
|
|
|
|
Returns the last character in our string as a Unicode character. Const version.
|
|
|
|
|
|
* Adds the passed in inChar to the end of our string.
|
|
Adds the passed in inChar to the end of our string.
|
|
Adds the passed in inChar to the end of our string.
|
|
Adds the passed in c style (NULL terminated) string to the end of our string.
|
|
Adds the passed in Unicode (NULL terminated) string to the end of our string.
|
|
Adds the passed in CP_String string to the end of our string.
|
|
Appends the passed in inChar to the end of our string.
|
|
Appends the passed in inChar to the end of our string.
|
|
Appends the passed in inChar to the end of our string.
|
|
Appends the passed in inChar to the end of our string repeating inCount times.
|
|
Appends the passed in c style string to the end of our string.
|
|
Appends the passed in c style string to the end of our string starting at the beginning and copying inLength characters.
|
|
Appends the passed in NULL terminated string of Unicode characters to the end of our string.
|
|
Appends the passed in NULL terminated string of Unicode characters to the end of our string, copying the number of characters specified in inLength.
|
|
Appends characters from the passed in string starting at the character specified in inStartIndex and going for the number of characters specified in inLength.
|
|
Add the CPUniChar to the end of this string.
|
|
Resets the contents of this string to the passed in char.
|
|
Resets the contents of this string to the passed in Unicode characer.
|
|
Resets the contents of this string to the passed in char * to a c style (NULL terminated) string.
|
|
Resets the contents of this string to the passed in Unicode (NULL terminated) string.
|
|
Resets the contents of this string to the passed in CP_String.
|
|
Replaces the current contents of the string with the passed in char.
|
|
Replaces the current contents of the string with the passed in Unicode char.
|
|
Replaces the current contents of the string with the passed in char repeating inCount number of times.
|
|
Replaces the current contents of the string with the passed in Unicode char repeating inCount number of times.
|
|
Replaces the current contents of the string with the passed in c style (NULL terminated) string.
|
|
Replaces the current contents of the string with the passed in c style (NULL terminated) string, using inLength characters from the string. If the string is shorter than the number of characters, then the string will only contain the actual characers and be shorter than the passed in length.
|
|
Replaces the current contents of the string with the passed in NULL terminated string of Unicode characters.
|
|
Replaces the current contents of the string with the passed in NULL terminated string of Unicode characters, copying inLength characters from the passed in string.
|
|
Replaces the current contents of the string with the passed in CP_String. We start from the source string in the passed in inStartIndex and copy inLength characters.
|
|
Compare the contents of the passed in string to the contents of this string.
|
|
Compare the contents of the passed in string to the contents of this string.
|
|
Compare the contents of the passed in string to the contents of this string.
|
|
Compare the contents of the passed in string to the contents of this string. This version uses only a portion of both strings to compare against as listed below in the parameters.
|
|
Compare the contents of the passed in string to the contents of this string. This version uses only a portion of both strings to compare against as listed below in the parameters.
|
|
Erase some of the characters in this string. The erasure begins at inIndex and goes for inCount number of characters.
|
|
Erases the last character in the string.
|
|
Return the index into this string of the passed in character starting at the passed in starting location.
|
|
Return the index into this string of the passed in c style (NULL terminated) string starting at the passed in starting location.
|
|
Return the index into this string of the passed in c style (NULL terminated) string starting at the passed in starting location and using inLength characters from the passed in string.
|
|
Return the index into this string of the passed in Unicode (NULL terminated) string starting at the passed in starting location.
|
|
Return the index into this string of the passed in Unicode (NULL terminated) string starting at the passed in starting location and using inLength characters from the passed in string.
|
|
Return the index into this string of the passed in CP_String string starting at the passed in starting location.
|
|
Return the index into this string of the passed in Unicode character, searching the string backwards and starting at inIndex.
|
|
Return the index into this string of the passed in c style (NULL terminated) string, searching the string backwards and starting at inIndex.
|
|
Return the index into this string of the passed in c style (NULL terminated) string, searching the string backwards and starting at inIndex and using inLength characters from the source string.
|
|
Return the index into this string of the passed in Unicode (NULL terminated) string, searching the string backwards and starting at inIndex.
|
|
Return the index into this string of the passed in Unicode (NULL terminated) string, searching the string backwards and starting at inIndex and using inLength characters from the source string.
|
|
Return the index into this string of the passed in CP_String string, searching the string backwards and starting at inIndex.
|
|
Return the index of the first occurrance of inChar in this string.
|
|
Return the index of the first occurrance of inSting in this string.
|
|
Return the index of the first occurrance of inSting in this string.
|
|
Return the index of the first occurrance of inSting in this string.
|
|
Return the index of the first occurrance of inSting in this string.
|
|
Return the index of the first occurrance of inSting in this string.
|
|
Return the index of the last occurrance of inChar in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inChar in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString in this string. The search is backwards in the string
|
|
Return the index of the first occurrance of inChar that is not in this string.
|
|
Return the index of the first occurrance of inString that is not in this string.
|
|
Return the index of the first occurrance of inString that is not in this string.
|
|
Return the index of the first occurrance of inString that is not in this string.
|
|
Return the index of the first occurrance of inString that is not in this string.
|
|
Return the index of the first occurrance of inString that is not in this string.
|
|
Return the index of the last occurrance of inChar that is not in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString that is not in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString that is not in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString that is not in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString that is not in this string. The search is backwards in the string
|
|
Return the index of the last occurrance of inString that is not in this string. The search is backwards in the string
|
|
Insert the passed in Unicode character into this string starting at inIndex.
|
|
Insert the passed in Unicode character into this string starting at inIndex and repeating inCount number of times.
|
|
Insert the passed in c style (NULL terminated) string into this string starting at inIndex.
|
|
Insert the passed in c style (NULL terminated) string into this string starting at inIndex and using inLength number of characters from the source string.
|
|
Insert the passed in Unicode (NULL terminated) string into this string starting at inIndex.
|
|
Insert the passed in Unicode (NULL terminated) string into this string starting at inIndex and using inLength characters from the soruce string.
|
|
Insert a portion of the passed in CP_String string into this string starting at inIndex in this string. The portion of the string begin used begins at inStartIndex into the passed in string, and uses inLength characters from that string.
|
|
Replaces some of the characers in this string with the passed in Unicode character. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string. The passed in character is repeated inCharCount times.
|
|
Replaces some of the characers in this string with the passed in c style (NULL terminated) string. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string.
|
|
Replaces some of the characers in this string with the passed in c style (NULL terminated) string. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string. Only the number of characters specified in inLength are used from the source string.
|
|
Replaces some of the characers in this string with the passed in Unicode (NULL terminated) string. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string.
|
|
Replaces some of the characers in this string with the passed in Unicode (NULL terminated) string. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string. Only the number of characters specified in inLength are used from the source string.
|
|
Replaces some of the characers in this string with the passed in CP_String string. The passed in character replaces the characters in this string starting at inIndex and going for inCount length in this string. Only the number of characters specified in inLength are used from the source string, and starting at inStartIndex in the source string.
|
|
Returns the number of characters in this string.
|
|
|
|
Resizes this string to hold the passed in number of characters. If the string is made shorter, then any extra characters are removed, and if the string is made longer, then extra space is added to the end of the existing string.
|
|
Resizes this string to hold the passed in number of characters. If the string is made shorter, then any extra characters are remved, and if the string is made longer, then extra space is added to the end of the existing string.
|
|
Return the capacity of this string. This is the amount of memory allocated at the moment, and might not be the same as the length/size returned.
|
|
Return true if this string contains 0 characters.
|
|
Return true if this string contains 0 characters.
|
|
Clears out or erases all of the current content of the string, and makes this into a zero length string.
|
|
Returns an iterator for accessing the contents of this string. The iterator points to the beginning of the string and is a forward_iterator.
|
|
Returns an iterator for accessing the contents of this string. The iterator points to the beginning of the string and is a forward_iterator.
|
|
Returns an iterator for accessing the contents of this string. The iterator points to the end of the string and is a forward_iterator.
|
|
Returns an iterator for accessing the contents of this string. The iterator points to the end of the string and is a forward_iterator.
|
|
Returns a reverse_iterator for accessing the contents of this string. The iterator points to the end of the string and is a reverse_iterator.
|
|
Returns a reverse_iterator for accessing the contents of this string. The iterator points to the end of the string and is a reverse_iterator.
|
|
Returns a reverse_iterator for accessing the contents of this string. The iterator points to the end of the string and is a reverse_iterator.
|
|
Returns a reverse_iterator for accessing the contents of this string. The iterator points to the end of the string and is a reverse_iterator.
|
|
Return a string containing a portion of this string.
|
|
Copy some characters from our string into the passed in char * inOutBuffer.
|
|
Copy some characters from our string into the passed in Unicode * inOutBuffer. Determines the effective length rlen of the string to copy as the smaller of inCount and size(). inOutBuffer shall designate an array of at least rlen elements. The function then copies rlen characters starting at index into the buffer provided.
|
|
Swap the contents of the passed in string with the contents of ourselves.
|
|
Reserve space to hold the passed in number of characters in our string.
|
|
Assignment operator to set the string from a Carbon CFStringRef string.
|
|
Assignment operator to set the string from a Carbon CFStringRef string.
|
|
Assignment operator to set the string from a Carbon CFMutableStringRef string.
|
|
Assignment operator to set the string from a Carbon CFMutableStringRef string.
|
|
Return the CFStringRef containing the string data.
|
|
Return the CFMutableStringRef containing the string data.
|
|
Return the CFStringRef containing the string data as a CP_ResourcePtr wrapped resource.
|
|
Return the CFMutableStringRef containing the string data as a CP_ResourcePtr wrapped resource.
|
|
|
|
Return a portion of this string in the passed in outBuffer.
|
|
Make sure our CoreFoundation string ref is mutable and has a retain count of 1 (i.e. we're the only one referencing it). If it isn't, create a mutable copy that we can work on (copy-on-write).
|
|
Combines the contents of the passed in strings to each other and returns a new string.
|
|
Combines the contents of the passed in strings to each other and returns a new string.
|
|
Combines the contents of the passed in strings to each other and returns a new string.
|
|
Combines the contents of the passed in strings to each other and returns a new string.
|
|
Combines the contents of the passed in strings to each other and returns a new string.
|
|
Compares the passed in inLeftSide character to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide Unicode character string to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide character to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide Unicode character string to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character string.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
Compares the passed in inLeftSide character to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide Unicode character string to the contents of the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character.
|
|
Compares the passed in inLeftSide CP_String to the Unicode character string.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
Compares the passed in inLeftSide CP_String to the passed in CP_String.
|
|
|
|
Pointer to buffer returned for calls to c_str(). |
|
Amount of data our c style string member can hold (excluding terminating zero character). |
|
Flag to indicate if our return buffers need to be rebuilt. |
|
CoreFoundation CFString holding our string data. Only one of fImmutableString and fMutableString are != NULL at any time, depending on the mutability of the string. |
|
CoreFoundation CFString holding our string data. Only one of fImmutableString and fMutableString are != NULL at any time, depending on the mutability of the string. |
|
Pointer to buffer returned for calls to w_str(). |
|
Number of characters our fStringData member can hold (excluding terminating zero character). |