| CFx SDK Documentation 2024 SP0
    | 
#include <OdString.h>
 
  
| Classes | |
| struct | lessnocase | 
| Public Member Functions | |
| OdString () | |
| OdString (const OdString &source) | |
| OdString (OdChar ch, int length) | |
| OdString (const OdChar *source) | |
| OdString (const OdChar *source, int length) | |
| OdString (const char *lpch, OdCodePageId codepage=CP_CNT) | |
| OdString (const OdChar16_t *lpch, OdCodePageId codepage=CP_CNT) | |
| OdString (const char *lpch, int nLength, OdCodePageId codepage=CP_CNT) | |
| OdString (const OdAnsiString &) | |
| int | getLength () const | 
| int | getLengthA () const | 
| bool | isEmpty () const | 
| void | empty () | 
| OdChar | getAt (int charIndex) const | 
| OdChar | operator[] (int charIndex) const | 
| void | setAt (int charIndex, OdChar ch) | 
| const OdChar * | c_str () const | 
| operator const OdChar * () const | |
| operator const char * () const | |
| OdString & | operator= (const OdString &source) | 
| OdString & | operator= (OdChar ch) | 
| OdString & | operator= (const OdChar *source) | 
| OdString & | operator= (const OdChar16_t *source) | 
| OdString & | operator= (const OdAnsiString &source) | 
| OdString & | operator= (const char *source) | 
| OdString & | operator+= (const OdString &string) | 
| OdString & | operator+= (OdChar ch) | 
| OdString & | operator+= (const OdChar *string) | 
| OdString & | operator+= (const char *string) | 
| int | compare (const OdChar *otherString) const | 
| int | compare (const OdString &otherString) const | 
| int | compare (const char *otherString) const | 
| int | iCompare (const OdChar *otherString) const | 
| int | iCompare (const OdString &otherString) const | 
| OdString | mid (int startIndex, int length) const | 
| OdString | mid (int startIndex) const | 
| OdString | left (int length) const | 
| OdString | right (int length) const | 
| OdString | spanIncluding (const OdChar *charSet) const | 
| OdString | spanIncluding (const OdString &charSet) const | 
| OdString | spanExcluding (const OdChar *charSet) const | 
| OdString | spanExcluding (const OdString &charSet) const | 
| OdString & | makeUpper () | 
| OdString & | makeLower () | 
| OdString & | makeReverse () | 
| OdString & | trimRight () | 
| OdString & | trimLeft () | 
| OdString & | trimRight (OdChar whiteChar) | 
| OdString & | trimRight (const OdChar *whiteChars) | 
| OdString & | trimRight (const OdString &whiteChars) | 
| OdString & | trimLeft (OdChar whiteChar) | 
| OdString & | trimLeft (const OdChar *whiteChars) | 
| OdString & | trimLeft (const OdString &whiteChars) | 
| int | replace (OdChar oldChar, OdChar newChar) | 
| int | replace (const OdChar *oldString, const OdChar *newString) | 
| int | replace (const OdString &oldString, const OdString &newString) | 
| int | remove (OdChar chRemove) | 
| int | insert (int insertIndex, OdChar insertChar) | 
| int | insert (int insertIndex, const OdChar *insertString) | 
| int | insert (int insertIndex, const OdString &insertString) | 
| int | deleteChars (int deleteIndex, int count=1) | 
| int | find (OdChar searchChar) const | 
| int | reverseFind (OdChar searchChar) const | 
| int | reverseFind (OdChar searchChar, int startIndex) const | 
| int | find (OdChar searchChar, int startIndex) const | 
| int | findOneOf (const OdChar *charSet) const | 
| int | find (const OdChar *searchString) const | 
| int | find (const OdChar *searchString, int startIndex) const | 
| OdString & | format (const OdChar *formatString,...) | 
| OdString & | formatV (const OdChar *formatString, va_list argList) | 
| OdChar * | getBuffer (int minBufLength) | 
| void | releaseBuffer (int newLength=-1) | 
| OdChar * | getBufferSetLength (int length) | 
| void | freeExtra () | 
| OdChar * | lockBuffer () | 
| void | unlockBuffer () | 
| ~OdString () | |
| int | getAllocLength () const | 
| void | preallocate (int length) | 
| Static Public Attributes | |
| FIRSTDLL_EXPORT_STATIC static const OdString | kEmpty | 
| Protected Member Functions | |
| OdString (OdStringData *pData) | |
| OdStringData * | getData () const | 
| void | init () | 
| void | allocCopy (OdString &destString, int copyLength, int copyIndex, int extraLength) const | 
| void | allocBuffer (int length, bool allocAlways=false) | 
| void | assignCopy (int sourceLength, const OdChar *source) | 
| void | concatCopy (int sourceLength1, const OdChar *source1, int sourceLength2, const OdChar *source2) | 
| void | concatInPlace (int sourceLength, const OdChar *source) | 
| void | copyBeforeWrite () | 
| void | allocBeforeWrite (int newLength) | 
| void | release () | 
| bool | isUnicodeNotInSync () const | 
| void | syncUnicode () const | 
| OdAnsiString * | getAnsiString () const | 
| void | freeAnsiString () const | 
| Static Protected Member Functions | |
| static void | release (OdStringData *pStringData) | 
| static int | safeStrlen (const OdChar *string) | 
| static void | freeData (OdStringData *pStringData) | 
| Protected Attributes | |
| OdStringData * | m_pData | 
| Static Protected Attributes | |
| static FIRSTDLL_EXPORT_STATIC OdStringData | kEmptyData | 
| Friends | |
| class | OdAnsiString | 
| FIRSTDLL_EXPORT OdString | operator+ (const OdString &string1, const OdString &string2) | 
| FIRSTDLL_EXPORT OdString | operator+ (const OdString &string, OdChar ch) | 
| FIRSTDLL_EXPORT OdString | operator+ (OdChar ch, const OdString &string) | 
| FIRSTDLL_EXPORT OdString | operator+ (const OdString &string1, const OdChar *string2) | 
| FIRSTDLL_EXPORT OdString | operator+ (const OdChar *string1, const OdString &string2) | 
This class implements character String objects in the ODA Platform.
<group Other_Classes>
Definition at line 94 of file OdString.h.
| 
 | inline | 
Definition at line 100 of file OdString.h.
| OdString::OdString | ( | const OdString & | source | ) | 
| source | [in] Source. | 
| OdString::OdString | ( | OdChar | ch, | 
| int | length | ||
| ) | 
| ch | [in] Character to repeat. | 
| length | [in] Number of characters. | 
| OdString::OdString | ( | const OdChar * | source | ) | 
| OdString::OdString | ( | const OdChar * | source, | 
| int | length | ||
| ) | 
| OdString::OdString | ( | const char * | lpch, | 
| OdCodePageId | codepage = CP_CNT | ||
| ) | 
| OdString::OdString | ( | const OdChar16_t * | lpch, | 
| OdCodePageId | codepage = CP_CNT | ||
| ) | 
| OdString::OdString | ( | const char * | lpch, | 
| int | nLength, | ||
| OdCodePageId | codepage = CP_CNT | ||
| ) | 
| OdString::OdString | ( | const OdAnsiString & | ) | 
| 
 | explicitprotected | 
| OdString::~OdString | ( | ) | 
| 
 | protected | 
Assures the character buffer of this String object is at least the specified size.
| newLength | [in] New length of buffer. | 
Allocates the specified number of characters for the character buffer of this String object.
| length | [in] buffer length. allocAlways - if true, allocates new OdStringData even for 0 length unicode buffer (for ansi string constructors) | 
| 
 | protected | 
Copies the specified number of characters from this String object to the destination String object.
| destString | [out] Destination string. | 
| copyLength | [in] Number of characters to copy. | 
| copyIndex | [in] First byte to copy. | 
| extraLength | [in] Extra characters to allocate. | 
Copies the specified string to this String object.
| sourceLength | [in] Number of characters to copy. | 
| source | [in] Source string. | 
| 
 | inline | 
Returns the underlying OdChar array (buffer) of this String object.
Definition at line 203 of file OdString.h.
| int OdString::compare | ( | const char * | otherString | ) | const | 
Case sensitive string comparison. 
| otherString | [in] Other string. | 
Condition < 0 This String object < otherString. 0 This String object == otherString.
0 This String object > otherString.
| 
 | inline | 
Case sensitive string comparison. 
| otherString | [in] Other string. | 
Condition < 0 This String object < otherString. 0 This String object == otherString.
0 This String object > otherString.
Definition at line 326 of file OdString.h.
| 
 | inline | 
Case sensitive string comparison. 
| otherString | [in] Other string. | 
Condition < 0 This String object < otherString. 0 This String object == otherString.
0 This String object > otherString.
Definition at line 348 of file OdString.h.
| 
 | protected | 
Concatenates and copies the specified strings to this String object.
| sourceLength1 | [in] Number of characters in first string to copy. | 
| sourceLength2 | [in] Number of characters in second string to copy. | 
| source1 | [in] First source string. | 
| source2 | [in] Second source string. | 
Concatenates the string to this String object.
| sourceLength | [in] Number of characters to copy. | 
| source | [in] Source string. | 
| 
 | protected | 
Assures there are no multiple references to the StringData associated with this String object.
| int OdString::deleteChars | ( | int | deleteIndex, | 
| int | count = 1 | ||
| ) | 
Deletes the specified number characters from this String object.
| deleteIndex | [in] Deletion index. | 
| count | [in] Number of characters to delete. | 
| void OdString::empty | ( | ) | 
Sets this String object to the empty string.
| int OdString::find | ( | const OdChar * | searchString | ) | const | 
Returns the first occurrence of the specified string in this String object.
| searchString | [in] Search string. | 
| int OdString::find | ( | const OdChar * | searchString, | 
| int | startIndex | ||
| ) | const | 
Returns the first occurrence of the specified string in this String object.
| searchString | [in] Search string. | 
| startIndex | [in] Start index of search. | 
| int OdString::find | ( | OdChar | searchChar | ) | const | 
Returns the first occurrence of the specified character in this String object.
| searchChar | [in] Search character. | 
| int OdString::find | ( | OdChar | searchChar, | 
| int | startIndex | ||
| ) | const | 
Returns the first occurrence of the specified character in this String object.
| searchChar | [in] Search character. | 
| startIndex | [in] Start index of search. | 
| int OdString::findOneOf | ( | const OdChar * | charSet | ) | const | 
Returns the first occurrence in this String object of any member of the specified character set.
| charSet | [in] Character set. | 
Assigns a value to this String object using a printf-style format string and arguments.
| formatString | [in] Format string. | 
Assigns a value to this String object using a vsprintf-style format string and argument list.
| formatString | [in] Format string. | 
| argList | [in] Argument list. | 
| 
 | protected | 
| 
 | staticprotected | 
Frees the specified StringData object.
| pStringData | [in] Pointer to the StringData object. | 
| void OdString::freeExtra | ( | ) | 
Releases any unused memory allocated by this String object.
| 
 | inline | 
Returns the number of characters allocated for the underlying OdChar array (buffer) in this String object.
Definition at line 1088 of file OdString.h.
| 
 | inlineprotected | 
Definition at line 1232 of file OdString.h.
| 
 | inline | 
Returns the single character of this String object at the specified position.
| charIndex | [in] Character index. | 
Definition at line 159 of file OdString.h.
| OdChar * OdString::getBuffer | ( | int | minBufLength | ) | 
Returns a modifiable C style OdChar array (buffer) of the specified minimum length for this String object.
| minBufferLength | [in] Minimum buffer length. | 
The pointer returned by this function is not valid after releaseBuffer() is called.
| OdChar * OdString::getBufferSetLength | ( | int | length | ) | 
Returns a modifiable C style OdChar array (buffer) of of the specified length for this String object.
| length | [in] buffer length. | 
The pointer returned by this function is not valid after releaseBuffer() is called.
| 
 | inlineprotected | 
Returns the StringData for this String object.
Definition at line 1115 of file OdString.h.
| 
 | inline | 
Returns the number of characters in this String object.
Definition at line 133 of file OdString.h.
| int OdString::getLengthA | ( | ) | const | 
| 
 | inline | 
Case insensitive string comparison. 
| otherString | [in] Other string. | 
Condition < 0 This String object < otherString. 0 This String object == otherString.
0 This String object > otherString.
Definition at line 401 of file OdString.h.
| 
 | inline | 
Case insensitive string comparison. 
| otherString | [in] Other string. | 
Condition < 0 This String object < otherString. 0 This String object == otherString.
0 This String object > otherString.
Definition at line 423 of file OdString.h.
| 
 | protected | 
Initializes this String object to an empty string.
| int OdString::insert | ( | int | insertIndex, | 
| const OdChar * | insertString | ||
| ) | 
| insertString | [in] String to insert. | 
Inserts the specified string into this String object.
| insertIndex | [in] Insertion index. | 
| insertString | [in] String to insert. | 
| 
 | inline | 
Inserts the specified string into this String object.
| insertIndex | [in] Insertion index. | 
| insertString | [in] String to insert. | 
Definition at line 797 of file OdString.h.
| int OdString::insert | ( | int | insertIndex, | 
| OdChar | insertChar | ||
| ) | 
Inserts the specified character into this String object.
\param insertIndex [in] Insertion index.
| insertChar | [in] Character to insert. | 
| 
 | inline | 
Returns true and only if this String object is empty.
Definition at line 144 of file OdString.h.
| 
 | inlineprotected | 
Definition at line 1227 of file OdString.h.
| OdString OdString::left | ( | int | length | ) | const | 
Returns the leftmost substring of the specified length from this String object.
| length | [in] Length of substring. | 
| OdChar * OdString::lockBuffer | ( | ) | 
Enables reference counting for this String object.
| OdString & OdString::makeLower | ( | ) | 
Converts this String object to lower case.
| OdString & OdString::makeReverse | ( | ) | 
Reverses this String object.
| OdString & OdString::makeUpper | ( | ) | 
Converts this String object to upper case.
| OdString OdString::mid | ( | int | startIndex | ) | const | 
Returns the substring specified by a start index from this String object.
| startIndex | [in] Starting index. | 
| OdString OdString::mid | ( | int | startIndex, | 
| int | length | ||
| ) | const | 
Returns the substring specified by a start index and a length from this String object.
| startIndex | [in] Starting index. | 
| length | [in] Length of substring. | 
| OdString::operator const char * | ( | ) | const | 
| 
 | inline | 
Returns the underlying character array (buffer) of this String object.
Definition at line 215 of file OdString.h.
| OdString & OdString::operator+= | ( | const char * | string | ) | 
Concatenation-Equals Operator.
\param string [in] Input value for concatenation
Concatenation-Equals Operator.
\param string [in] Input value for concatenation
Concatenation-Equals Operator.
\param string [in] Input value for concatenation
Concatenation-Equals Operator.
\param ch [in] Input value for concatenation
| OdString & OdString::operator= | ( | const char * | source | ) | 
| OdString & OdString::operator= | ( | const OdAnsiString & | source | ) | 
| OdString & OdString::operator= | ( | const OdChar16_t * | source | ) | 
| 
 | inline | 
Indexing Operator
| charIndex | [in] Character index. | 
Definition at line 177 of file OdString.h.
| 
 | inline | 
Assures the character buffer of this String object is at least the specified size.
| length | [in] New length of internal buffer. | 
Definition at line 1098 of file OdString.h.
| 
 | protected | 
Releases the reference to the specified StringData object.
| pStringData | [in] Pointer to the StringData object. | 
Decrements the reference count of the StringData object.
When its reference count reaches zero, the StringData object is freed.
| 
 | staticprotected | 
| void OdString::releaseBuffer | ( | int | newLength = -1 | ) | 
Releases a buffer obtained by getBuffer() or getBufferSetLength(), and sets its length.
| newLength | [in] New buffer length. | 
| int OdString::remove | ( | OdChar | chRemove | ) | 
Removes all occurrences of the specified character from this String object.
| removeChar | [in] Character to remove. | 
Replaces all occurrences of the specified string in this String object.
| oldString | [in] Old string. | 
| newString | [in] New string. | 
Replaces all occurrences of the specified string in this String object.
| oldString | [in] Old string. | 
| newString | [in] New string. | 
Definition at line 727 of file OdString.h.
Replaces all occurrences of the specified character in this String object.
| oldChar | [in] Old character. | 
| newChar | [in] New character. | 
| int OdString::reverseFind | ( | OdChar | searchChar | ) | const | 
Returns the last occurrence of the specified character in this String object.
| searchChar | [in] Search character. | 
| int OdString::reverseFind | ( | OdChar | searchChar, | 
| int | startIndex | ||
| ) | const | 
Returns the last occurrence of the specified character in this String object.
| searchChar | [in] Search character. | 
| startIndex | [in] An index from which to start searching back. | 
| OdString OdString::right | ( | int | length | ) | const | 
Returns the rightmost substring of the specified length from this String object.
| length | [in] Length of substring. | 
| 
 | inlinestaticprotected | 
Returns the length of the specified string.
| string | [in] 0 terminated string or NULL. | 
Definition at line 1218 of file OdString.h.
Sets the single character of this String object at the specified position.
| charIndex | [in] Character index. | 
| ch | [in] Character. | 
Returns the longest leftmost substring of this String object that consists solely of characters that are not contained in the specified character set.
| charSet | [in] Character set. | 
Returns the longest leftmost substring of this String object that consists solely of characters that are not contained in the specified character set.
| charSet | [in] Character set. | 
Definition at line 535 of file OdString.h.
Returns the longest leftmost substring of this String object that consists solely of characters that are contained in the specified character set.
| charSet | [in] Character set. | 
Returns the longest leftmost substring of this String object that consists solely of characters that are contained in the specified character set.
| charSet | [in] Character set. | 
Definition at line 494 of file OdString.h.
| 
 | protected | 
| OdString & OdString::trimLeft | ( | ) | 
Removes all whitespace from the left side of this String object.
Removes all whitespace from the left side of this String object.
| whiteChars | [in] Whitespace characters. | 
Removes all whitespace from the left side of this String object.
| whiteChars | [in] Whitespace characters. | 
Definition at line 681 of file OdString.h.
Removes all whitespace from the left side of this String object.
| whiteChar | [in] Whitespace character. | 
| OdString & OdString::trimRight | ( | ) | 
Removes all whitespace from the right side of this String object.
Removes all whitespace from the right side of this String object.
| whiteChars | [in] Whitespace characters. | 
Removes all whitespace from the right side of this String object.
| whiteChars | [in] Whitespace characters. | 
Definition at line 631 of file OdString.h.
Removes all whitespace from the right side of this String object.
| whiteChar | [in] Whitespace character. | 
| void OdString::unlockBuffer | ( | ) | 
Disables reference counting for this String object.
| 
 | friend | 
Definition at line 1240 of file OdString.h.
| 
 | friend | 
| 
 | friend | 
| 
 | friend | 
| 
 | friend | 
Concatenation Operator.
| 
 | friend | 
| 
 | static | 
Definition at line 98 of file OdString.h.
| 
 | staticprotected | 
Definition at line 1105 of file OdString.h.
| 
 | protected | 
Pointer to the underlying OdChar array (buffer).
Definition at line 1110 of file OdString.h.