![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Class defines a variable-length sequence of 8-bit characters. Despite class name (kept for historical reasons), it is intended to store UTF-8 string, not just ASCII characters. However, multi-byte nature of UTF-8 is not considered by the following methods: More...
#include <TCollection_AsciiString.hxx>
Public Member Functions | |
| TCollection_AsciiString () noexcept | |
| Initializes a AsciiString to an empty AsciiString. | |
| TCollection_AsciiString (const char *const theMessage) | |
| Initializes a AsciiString with a CString (null-terminated). | |
| TCollection_AsciiString (const char *const theMessage, const int theLength) | |
| Initializes a AsciiString with a CString and explicit length. | |
| TCollection_AsciiString (const char theChar) | |
| Initializes a AsciiString with a single character. | |
| TCollection_AsciiString (const int theLength, const char theFiller) | |
| Initializes an AsciiString with specified length space allocated and filled with filler character. This is useful for buffers. | |
| TCollection_AsciiString (const int theValue) | |
| Initializes an AsciiString with an integer value. | |
| TCollection_AsciiString (const double theValue) | |
| Initializes an AsciiString with a real value. | |
| TCollection_AsciiString (const TCollection_AsciiString &theString) | |
| Initializes a AsciiString with another AsciiString. | |
| TCollection_AsciiString (TCollection_AsciiString &&theOther) noexcept | |
| Move constructor. | |
| TCollection_AsciiString (const TCollection_AsciiString &theString, const char theChar) | |
| Initializes a AsciiString with copy of another AsciiString concatenated with the message character. | |
| TCollection_AsciiString (const TCollection_AsciiString &theString, const char *const theMessage) | |
| Initializes a AsciiString with copy of another AsciiString concatenated with the message string. | |
| TCollection_AsciiString (const TCollection_AsciiString &theString, const TCollection_AsciiString &theOtherString) | |
| Initializes a AsciiString with copy of another AsciiString concatenated with the message string. | |
| TCollection_AsciiString (const TCollection_ExtendedString &theExtendedString, const char theReplaceNonAscii=0) | |
| Creation by converting an extended string to an ascii string. If replaceNonAscii is non-null character, it will be used in place of any non-ascii character found in the source string. Otherwise, creates UTF-8 unicode string. | |
| TCollection_AsciiString (const wchar_t *theStringUtf) | |
| Initialize UTF-8 Unicode string from wide-char string considering it as Unicode string (the size of wide char is a platform-dependent - e.g. on Windows wchar_t is UTF-16). | |
| template<std::size_t N> | |
| TCollection_AsciiString (const char(&theLiteral)[N]) | |
| Template constructor for string literals or char arrays. | |
| void | AssignCat (const char theOther) |
| Appends other character to this string. This is an unary operator. | |
| void | operator+= (const char theOther) |
| void | AssignCat (const int theOther) |
| Appends other integer to this string. This is an unary operator. | |
| void | operator+= (const int theOther) |
| void | AssignCat (const double theOther) |
| Appends other real number to this string. This is an unary operator. | |
| void | operator+= (const double theOther) |
| void | AssignCat (const TCollection_ExtendedString &theOther, const char theReplaceNonAscii=0) |
| Appends an extended string to this ASCII string. If theReplaceNonAscii is non-null character, it will be used in place of any non-ASCII character found in the source string. Otherwise, appends UTF-8 representation of the source string. | |
| void | operator+= (const TCollection_ExtendedString &theOther) |
| void | AssignCat (const wchar_t *theStringUtf) |
| Appends wide-char string converted to UTF-8 representation. | |
| void | operator+= (const wchar_t *theStringUtf) |
| void | AssignCat (const char *const theString, const int theLength) |
| Core implementation: Appends string (pointer and length) to this ASCII string. This is the primary implementation that all other AssignCat overloads redirect to. | |
| void | AssignCat (const TCollection_AsciiString &theOther) |
| Appends other string to this string. This is an unary operator. | |
| void | operator+= (const TCollection_AsciiString &theOther) |
| void | AssignCat (const char *const theCString) |
| Appends C string to this ASCII string. | |
| void | operator+= (const char *const theCString) |
| template<std::size_t N> | |
| void | AssignCat (const char(&theLiteral)[N]) |
| Template method for appending string literals or char arrays. For true string literals (const char[N] in code), the size is known at compile time. For char arrays (like sprintf buffers), we need to call strlen to get actual length. | |
| template<std::size_t N> | |
| void | operator+= (const char(&theLiteral)[N]) |
| void | Capitalize () |
| Converts the first character into its corresponding upper-case character and the other characters into lowercase. | |
| TCollection_AsciiString | Cat (const char *const theString, const int theLength) const |
| Core implementation: Appends string (pointer and length) to this ASCII string and returns a new string. This is the primary implementation that all other Cat overloads redirect to. | |
| TCollection_AsciiString | Cat (const char theOther) const |
| Appends other character to this string. | |
| TCollection_AsciiString | operator+ (const char theOther) const |
| TCollection_AsciiString | Cat (const int theOther) const |
| Appends other integer to this string. | |
| TCollection_AsciiString | operator+ (const int theOther) const |
| TCollection_AsciiString | Cat (const double theOther) const |
| Appends other real number to this string. | |
| TCollection_AsciiString | operator+ (const double theOther) const |
| TCollection_AsciiString | Cat (const TCollection_ExtendedString &theOther, const char theReplaceNonAscii=0) const |
| Appends extended string to this string. If theReplaceNonAscii is non-null character, it will be used in place of any non-ASCII character found in the source string. Otherwise, concatenates UTF-8 representation of the source string. | |
| TCollection_AsciiString | operator+ (const TCollection_ExtendedString &theOther) const |
| TCollection_AsciiString | Cat (const wchar_t *theStringUtf) const |
| Appends wide-char string converted to UTF-8 representation. | |
| TCollection_AsciiString | operator+ (const wchar_t *theStringUtf) const |
| TCollection_AsciiString | Cat (const TCollection_AsciiString &theOther) const |
| Appends other string to this string. | |
| TCollection_AsciiString | operator+ (const TCollection_AsciiString &theOther) const |
| TCollection_AsciiString | Cat (const char *const theCString) const |
| Appends C string to this ASCII string. | |
| TCollection_AsciiString | operator+ (const char *const theCString) const |
| template<std::size_t N> | |
| TCollection_AsciiString | Cat (const char(&theLiteral)[N]) const |
| Template method for concatenating string literals or char arrays. For safety, uses strlen to get actual string length. | |
| template<std::size_t N> | |
| TCollection_AsciiString | operator+ (const char(&theLiteral)[N]) const |
| void | Center (const int theWidth, const char theFiller) |
| Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens. | |
| void | ChangeAll (const char theChar, const char theNewChar, const bool theCaseSensitive=true) |
| Substitutes all the characters equal to aChar by NewChar in this AsciiString. The substitution can be case sensitive. If you don't use default case sensitive, no matter whether aChar is uppercase or not. | |
| void | Clear () |
| Removes all characters contained in this string. This produces an empty AsciiString. | |
| void | Copy (const char *const theString, const int theLength) |
| Core implementation: Copy string (pointer and length) to this ASCII string. This is the primary implementation that all other Copy overloads redirect to. Used as operator =. | |
| void | Copy (const char *const theCString) |
| Copy C string to this ASCII string. Used as operator =. | |
| void | operator= (const char *const theCString) |
| template<std::size_t N> | |
| void | Copy (const char(&theLiteral)[N]) |
| Template method for copying string literals or char arrays. For safety, uses strlen to get actual string length. | |
| template<std::size_t N> | |
| void | operator= (const char(&theLiteral)[N]) |
| void | Copy (const TCollection_AsciiString &theFromWhere) |
| Copy fromwhere to this string. Used as operator =. | |
| TCollection_AsciiString & | operator= (const TCollection_AsciiString &theOther) |
| Copy assignment operator. | |
| void | Move (TCollection_AsciiString &&theOther) |
| Moves string without reallocations. | |
| TCollection_AsciiString & | operator= (TCollection_AsciiString &&theOther) noexcept |
| Move assignment operator. | |
| void | Swap (TCollection_AsciiString &theOther) |
| Exchange the data of two strings (without reallocating memory). | |
| ~TCollection_AsciiString () | |
| Frees memory allocated by AsciiString. | |
| int | FirstLocationInSet (const char *const theSet, const int theSetLength, const int theFromIndex, const int theToIndex) const |
| Core implementation: Returns the index of the first character of this string that is present in the given character set (pointer and length). The search begins at index FromIndex and ends at index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. | |
| int | FirstLocationInSet (const TCollection_AsciiString &theSet, const int theFromIndex, const int theToIndex) const |
| Returns the index of the first character of this string that is present in Set. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. | |
| template<std::size_t N> | |
| int | FirstLocationInSet (const char(&theLiteral)[N], const int theFromIndex, const int theToIndex) const |
| Template method for FirstLocationInSet with string literals. | |
| int | FirstLocationNotInSet (const char *const theSet, const int theSetLength, const int theFromIndex, const int theToIndex) const |
| Core implementation: Returns the index of the first character of this string that is not present in the given character set (pointer and length). The search begins at index FromIndex and ends at index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. | |
| int | FirstLocationNotInSet (const TCollection_AsciiString &theSet, const int theFromIndex, const int theToIndex) const |
| Returns the index of the first character of this string that is not present in the set Set. The search begins to the index FromIndex and ends to the the index ToIndex in this string. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. | |
| template<std::size_t N> | |
| int | FirstLocationNotInSet (const char(&theLiteral)[N], const int theFromIndex, const int theToIndex) const |
| Template method for FirstLocationNotInSet with string literals. | |
| void | Insert (const int theWhere, const char theWhat) |
| Inserts a Character at position where. | |
| void | Insert (const int theWhere, const char *const theString, const int theLength) |
| Core implementation: Inserts a string (pointer and length) at position theWhere. This is the primary implementation that all other Insert overloads redirect to. | |
| void | Insert (const int theWhere, const TCollection_AsciiString &theWhat) |
| Inserts a AsciiString at position where. | |
| void | Insert (const int theWhere, const char *const theCString) |
| Inserts a C string at position theWhere. | |
| template<std::size_t N> | |
| void | Insert (const int theWhere, const char(&theLiteral)[N]) |
| Template method for inserting string literals with compile-time size deduction. This optimization avoids runtime strlen() calls and unnecessary conversions. | |
| void | InsertAfter (const int theIndex, const char *const theString, const int theLength) |
| Core implementation: Inserts string (pointer and length) after a specific index in this string. This is the primary implementation that all other InsertAfter overloads redirect to. Raises an exception if index is out of bounds (less than 0 or greater than the length). | |
| void | InsertAfter (const int theIndex, const TCollection_AsciiString &theOther) |
| Inserts an ASCII string after a specific index in this string. Raises an exception if index is out of bounds. | |
| void | InsertAfter (const int theIndex, const char *const theCString) |
| Inserts a C string after a specific index in this string. Raises an exception if index is out of bounds. | |
| template<std::size_t N> | |
| void | InsertAfter (const int theIndex, const char(&theLiteral)[N]) |
| Template method for inserting string literals or char arrays after a specific index. | |
| void | InsertBefore (const int theIndex, const char *const theString, const int theLength) |
| Core implementation: Inserts string (pointer and length) before a specific index in this string. This is the primary implementation that all other InsertBefore overloads redirect to. Raises an exception if index is out of bounds (less than 1 or greater than the length). | |
| void | InsertBefore (const int theIndex, const TCollection_AsciiString &theOther) |
| Inserts an ASCII string before a specific index in this string. Raises an exception if index is out of bounds. | |
| void | InsertBefore (const int theIndex, const char *const theCString) |
| Inserts a C string before a specific index in this string. Raises an exception if index is out of bounds. | |
| template<std::size_t N> | |
| void | InsertBefore (const int theIndex, const char(&theLiteral)[N]) |
| Template method for inserting string literals or char arrays before a specific index. | |
| bool | IsEmpty () const |
| Returns True if this string contains zero character. | |
| bool | IsEqual (const TCollection_AsciiString &theOther) const |
| Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==. | |
| bool | operator== (const TCollection_AsciiString &theOther) const |
| bool | IsEqual (const char *const theString, const int theLength) const |
| Core implementation: Returns true if the characters in this ASCII string are identical to the string (pointer and length). This is the primary implementation that string_view and CString overloads redirect to. | |
| bool | IsEqual (const char *const theCString) const |
| Returns true if the characters in this ASCII string are identical to the C string. | |
| bool | operator== (const char *const theCString) const |
| template<std::size_t N> | |
| bool | IsEqual (const char(&theLiteral)[N]) const |
| Template method for comparing with string literals with compile-time optimization. This optimization avoids runtime strlen() calls and unnecessary conversions. | |
| template<std::size_t N> | |
| bool | operator== (const char(&theLiteral)[N]) const |
| bool | IsDifferent (const TCollection_AsciiString &theOther) const |
| Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=. | |
| bool | operator!= (const TCollection_AsciiString &theOther) const |
| bool | IsDifferent (const char *const theString, const int theLength) const |
| Core implementation: Returns true if there are differences between this ASCII string and the string (pointer and length). This is the primary implementation that string_view and CString overloads redirect to. | |
| bool | IsDifferent (const char *const theCString) const |
| Returns true if there are differences between this ASCII string and C string. | |
| bool | operator!= (const char *const theCString) const |
| template<std::size_t N> | |
| bool | IsDifferent (const char(&theLiteral)[N]) const |
| Template method for comparing difference with string literals or char arrays. | |
| template<std::size_t N> | |
| bool | operator!= (const char(&theLiteral)[N]) const |
| bool | IsLess (const char *const theString, const int theLength) const |
| Core implementation: Returns TRUE if this string is lexicographically less than the string (pointer and length). This is the primary implementation that all other IsLess overloads redirect to. | |
| bool | IsLess (const TCollection_AsciiString &theOther) const |
| Returns TRUE if this string is 'ASCII' less than other. | |
| bool | operator< (const TCollection_AsciiString &theOther) const |
| bool | IsLess (const char *const theCString) const |
| Returns TRUE if this string is lexicographically less than C string. | |
| bool | operator< (const char *const theCString) const |
| template<std::size_t N> | |
| bool | IsLess (const char(&theLiteral)[N]) const |
| Template method for lexicographic comparison with string literals or char arrays. | |
| template<std::size_t N> | |
| bool | operator< (const char(&theLiteral)[N]) const |
| bool | IsGreater (const char *const theString, const int theLength) const |
| Core implementation: Returns TRUE if this string is lexicographically greater than the string (pointer and length). This is the primary implementation that all other IsGreater overloads redirect to. | |
| bool | IsGreater (const TCollection_AsciiString &theOther) const |
| Returns TRUE if this string is 'ASCII' greater than other. | |
| bool | operator> (const TCollection_AsciiString &theOther) const |
| bool | IsGreater (const char *const theCString) const |
| Returns TRUE if this string is lexicographically greater than C string. | |
| bool | operator> (const char *const theCString) const |
| template<std::size_t N> | |
| bool | IsGreater (const char(&theLiteral)[N]) const |
| Template method for lexicographic greater comparison with string literals or char arrays. | |
| template<std::size_t N> | |
| bool | operator> (const char(&theLiteral)[N]) const |
| bool | StartsWith (const char *const theStartString, const int theStartLength) const |
| Core implementation: Determines whether the beginning of this string instance matches the specified string (pointer and length). | |
| bool | StartsWith (const TCollection_AsciiString &theStartString) const |
| Determines whether the beginning of this string instance matches the specified string. | |
| bool | StartsWith (const char *const theCString) const |
| Determines whether the beginning of this string matches the specified C string. | |
| bool | EndsWith (const char *const theEndString, const int theEndLength) const |
| Core implementation: Determines whether the end of this string instance matches the specified string (pointer and length). | |
| bool | EndsWith (const TCollection_AsciiString &theEndString) const |
| Determines whether the end of this string instance matches the specified string. | |
| template<std::size_t N> | |
| bool | StartsWith (const char(&theLiteral)[N]) const |
| Template method for checking if string starts with a literal or char array. | |
| template<std::size_t N> | |
| bool | EndsWith (const char(&theLiteral)[N]) const |
| Template method for checking if string ends with a literal or char array. | |
| int | IntegerValue () const |
| Converts a AsciiString containing a numeric expression to an Integer. | |
| bool | IsIntegerValue () const |
| Returns True if the AsciiString contains an integer value. Note: an integer value is considered to be a real value as well. | |
| bool | IsRealValue (bool theToCheckFull=false) const |
| Returns True if the AsciiString starts with some characters that can be interpreted as integer or real value. | |
| bool | IsAscii () const |
| Returns True if the AsciiString contains only ASCII characters between ' ' and '~'. This means no control character and no extended ASCII code. | |
| void | LeftAdjust () |
| Removes all space characters in the beginning of the string. | |
| void | LeftJustify (const int theWidth, const char theFiller) |
| left justify Length becomes equal to Width and the new characters are equal to Filler. If Width < Length nothing happens. Raises an exception if Width is less than zero. | |
| int | Length () const |
| Returns number of characters in this string. This is the same functionality as 'strlen' in C. | |
| int | Location (const TCollection_AsciiString &theOther, const int theFromIndex, const int theToIndex) const |
| Returns an index in this string of the first occurrence of the string S in this string from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range. | |
| int | Location (const int theN, const char theC, const int theFromIndex, const int theToIndex) const |
| Returns the index of the nth occurrence of the character C in this string from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. | |
| void | LowerCase () |
| Converts this string to its lower-case equivalent. | |
| void | Prepend (const TCollection_AsciiString &theOther) |
| Inserts the string other at the beginning of this ASCII string. | |
| void | Print (Standard_OStream &theStream) const |
| Displays this string on a stream. | |
| void | Read (Standard_IStream &theStream) |
| Read this string from a stream. | |
| double | RealValue () const |
| Converts an AsciiString containing a numeric expression to a Real. | |
| void | RemoveAll (const char theC, const bool theCaseSensitive) |
| Remove all the occurrences of the character C in the string. | |
| void | RemoveAll (const char theWhat) |
| Removes every what characters from this string. | |
| void | Remove (const int theWhere, const int theHowMany=1) |
| Erases ahowmany characters from position where, where included. | |
| void | RightAdjust () |
| Removes all space characters at the end of the string. | |
| void | RightJustify (const int theWidth, const char theFiller) |
| Right justify. Length becomes equal to Width and the new characters are equal to Filler. if Width < Length nothing happens. Raises an exception if Width is less than zero. | |
| int | Search (const char *const theWhat, const int theWhatLength) const |
| Core implementation: Searches a string (pointer and length) in this string from the beginning and returns position of first item matching. It returns -1 if not found. | |
| int | Search (const TCollection_AsciiString &theWhat) const |
| Searches an AsciiString in this string from the beginning and returns position of first item what matching. It returns -1 if not found. | |
| int | Search (const char *const theCString) const |
| Searches a C string in this string from the beginning. | |
| template<std::size_t N> | |
| int | Search (const char(&theLiteral)[N]) const |
| Template method for searching string literals or char arrays. | |
| int | SearchFromEnd (const char *const theWhat, const int theWhatLength) const |
| Core implementation: Searches a string (pointer and length) in this string from the end and returns position of first item matching. It returns -1 if not found. | |
| int | SearchFromEnd (const TCollection_AsciiString &theWhat) const |
| Searches a AsciiString in another AsciiString from the end and returns position of first item what matching. It returns -1 if not found. | |
| int | SearchFromEnd (const char *const theCString) const |
| Searches a C string in this string from the end. | |
| template<std::size_t N> | |
| int | SearchFromEnd (const char(&theLiteral)[N]) const |
| Template method for searching string literals or char arrays from end. | |
| void | SetValue (const int theWhere, const char theWhat) |
| Replaces one character in the AsciiString at position where. If where is less than zero or greater than the length of this string an exception is raised. | |
| void | SetValue (const int theWhere, const char *const theString, const int theLength) |
| Core implementation: Replaces a part of this string with a string (pointer and length). This is the primary implementation that all other SetValue string overloads redirect to. | |
| void | SetValue (const int theWhere, const TCollection_AsciiString &theWhat) |
| Replaces a part of this string by another AsciiString. | |
| void | SetValue (const int theWhere, const char *const theCString) |
| Replaces a part of this ASCII string with a C string. | |
| TCollection_AsciiString | Split (const int theWhere) |
| Splits a AsciiString into two sub-strings. | |
| TCollection_AsciiString | SubString (const int theFromIndex, const int theToIndex) const |
| Creation of a sub-string of this string. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds. | |
| const char * | ToCString () const |
| Returns pointer to AsciiString (char *). This is useful for some casual manipulations. Warning: Because this "char *" is 'const', you can't modify its contents. | |
| TCollection_AsciiString | Token (const char *const theSeparators=" \t", const int theWhichOne=1) const |
| Extracts whichone token from this string. By default, the separators is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). separators contains all separators you need. If no token indexed by whichone is found, it returns empty AsciiString. | |
| void | Trunc (const int theHowMany) |
| Truncates this string to ahowmany characters. | |
| void | UpperCase () |
| Converts this string to its upper-case equivalent. | |
| int | UsefullLength () const |
| Length of the string ignoring all spaces (' ') and the control character at the end. | |
| char | Value (const int theWhere) const |
| Returns character at position where in this string. If where is less than zero or greater than the length of this string, an exception is raised. | |
| size_t | HashCode () const |
| Computes a hash code for the given ASCII string Returns the same integer value as the hash function for TCollection_ExtendedString. | |
Static Public Member Functions | |
| static const TCollection_AsciiString & | EmptyString () noexcept |
| Returns a const reference to a single shared empty string instance. This method provides access to a static empty string to avoid creating temporary empty strings. Use this method instead of constructing empty strings when you need a const reference. | |
| static bool | IsEqual (const TCollection_AsciiString &string1, const TCollection_AsciiString &string2) |
| Returns True when the two strings are the same. (Just for HashCode for AsciiString) | |
| static bool | IsEqual (const TCollection_AsciiString &string1, const char *const string2) |
| Returns True when the two strings are the same. (Just for HashCode for AsciiString) | |
| static bool | IsSameString (const char *const theString1, const int theLength1, const char *const theString2, const int theLength2, const bool theIsCaseSensitive) |
| Core implementation: Returns True if the two strings (pointer and length) contain same characters. This is the primary implementation that all other IsSameString overloads redirect to. | |
| static bool | IsSameString (const TCollection_AsciiString &theString1, const TCollection_AsciiString &theString2, const bool theIsCaseSensitive) |
| Returns True if the strings contain same characters. | |
| static bool | IsSameString (const TCollection_AsciiString &theString1, const char *const theCString, const bool theIsCaseSensitive) |
| Returns True if the string and C string contain same characters. | |
| static bool | IsSameString (const char *const theCString, const TCollection_AsciiString &theString2, const bool theIsCaseSensitive) |
| Returns True if the C string and string contain same characters. | |
| static bool | IsSameString (const char *const theCString1, const char *const theCString2, const bool theIsCaseSensitive) |
| Returns True if the two C strings contain same characters. | |
Class defines a variable-length sequence of 8-bit characters. Despite class name (kept for historical reasons), it is intended to store UTF-8 string, not just ASCII characters. However, multi-byte nature of UTF-8 is not considered by the following methods:
Class provides editing operations with built-in memory management to make AsciiString objects easier to use than ordinary character arrays. AsciiString objects follow value semantics; in other words, they are the actual strings, not handles to strings, and are copied through assignment. You may use HAsciiString objects to get handles to strings.
|
noexcept |
Initializes a AsciiString to an empty AsciiString.
|
inline |
Initializes a AsciiString with a CString (null-terminated).
| [in] | theMessage | the C string to initialize from |
| TCollection_AsciiString::TCollection_AsciiString | ( | const char *const | theMessage, |
| const int | theLength ) |
Initializes a AsciiString with a CString and explicit length.
| [in] | theMessage | the C string to initialize from |
| [in] | theLength | the length of the string |
| TCollection_AsciiString::TCollection_AsciiString | ( | const char | theChar | ) |
Initializes a AsciiString with a single character.
| [in] | theChar | the character to initialize from |
Initializes an AsciiString with specified length space allocated and filled with filler character. This is useful for buffers.
| [in] | theLength | the length to allocate |
| [in] | theFiller | the character to fill with |
| TCollection_AsciiString::TCollection_AsciiString | ( | const int | theValue | ) |
Initializes an AsciiString with an integer value.
| [in] | theValue | the integer value to convert to string |
| TCollection_AsciiString::TCollection_AsciiString | ( | const double | theValue | ) |
Initializes an AsciiString with a real value.
| [in] | theValue | the real value to convert to string |
| TCollection_AsciiString::TCollection_AsciiString | ( | const TCollection_AsciiString & | theString | ) |
Initializes a AsciiString with another AsciiString.
| [in] | theString | the string to copy from |
|
noexcept |
Move constructor.
| [in] | theOther | the string to move from |
| TCollection_AsciiString::TCollection_AsciiString | ( | const TCollection_AsciiString & | theString, |
| const char | theChar ) |
Initializes a AsciiString with copy of another AsciiString concatenated with the message character.
| [in] | theString | the string to copy |
| [in] | theChar | the character to append |
| TCollection_AsciiString::TCollection_AsciiString | ( | const TCollection_AsciiString & | theString, |
| const char *const | theMessage ) |
Initializes a AsciiString with copy of another AsciiString concatenated with the message string.
| [in] | theString | the string to copy |
| [in] | theMessage | the C string to append |
| TCollection_AsciiString::TCollection_AsciiString | ( | const TCollection_AsciiString & | theString, |
| const TCollection_AsciiString & | theOtherString ) |
Initializes a AsciiString with copy of another AsciiString concatenated with the message string.
| [in] | theString | the string to copy |
| [in] | theOtherString | the string to append |
| TCollection_AsciiString::TCollection_AsciiString | ( | const TCollection_ExtendedString & | theExtendedString, |
| const char | theReplaceNonAscii = 0 ) |
Creation by converting an extended string to an ascii string. If replaceNonAscii is non-null character, it will be used in place of any non-ascii character found in the source string. Otherwise, creates UTF-8 unicode string.
| [in] | theExtendedString | the extended string to convert |
| [in] | theReplaceNonAscii | replacement character for non-ASCII characters |
| TCollection_AsciiString::TCollection_AsciiString | ( | const wchar_t * | theStringUtf | ) |
Initialize UTF-8 Unicode string from wide-char string considering it as Unicode string (the size of wide char is a platform-dependent - e.g. on Windows wchar_t is UTF-16).
This constructor is unavailable if application is built with deprecated msvc option "-Zc:wchar_t-", since OCCT itself is never built with this option.
| [in] | theStringUtf | the wide character string to convert |
|
inline |
Template constructor for string literals or char arrays.
| [in] | theLiteral | the string literal or char array |
| TCollection_AsciiString::~TCollection_AsciiString | ( | ) |
Frees memory allocated by AsciiString.
Appends C string to this ASCII string.
| [in] | theCString | the C string to append |
Core implementation: Appends string (pointer and length) to this ASCII string. This is the primary implementation that all other AssignCat overloads redirect to.
| [in] | theString | pointer to the string to append |
| [in] | theLength | length of the string to append |
Appends other character to this string. This is an unary operator.
| [in] | theOther | the character to append |
|
inline |
Template method for appending string literals or char arrays. For true string literals (const char[N] in code), the size is known at compile time. For char arrays (like sprintf buffers), we need to call strlen to get actual length.
Example:
| [in] | theLiteral | the string literal or char array to append |
Appends other real number to this string. This is an unary operator.
| [in] | theOther | the real number to append |
Appends other integer to this string. This is an unary operator.
| [in] | theOther | the integer to append |
|
inline |
Appends other string to this string. This is an unary operator.
Example:
| [in] | theOther | the string to append |
| void TCollection_AsciiString::AssignCat | ( | const TCollection_ExtendedString & | theOther, |
| const char | theReplaceNonAscii = 0 ) |
Appends an extended string to this ASCII string. If theReplaceNonAscii is non-null character, it will be used in place of any non-ASCII character found in the source string. Otherwise, appends UTF-8 representation of the source string.
| [in] | theOther | the extended string to append |
| [in] | theReplaceNonAscii | replacement character for non-ASCII characters |
Appends wide-char string converted to UTF-8 representation.
| [in] | theStringUtf | the wide character string to append |
| void TCollection_AsciiString::Capitalize | ( | ) |
Converts the first character into its corresponding upper-case character and the other characters into lowercase.
Example:
|
inline |
Appends C string to this ASCII string.
| [in] | theCString | the C string to append |
| TCollection_AsciiString TCollection_AsciiString::Cat | ( | const char *const | theString, |
| const int | theLength ) const |
Core implementation: Appends string (pointer and length) to this ASCII string and returns a new string. This is the primary implementation that all other Cat overloads redirect to.
| [in] | theString | pointer to the string to append |
| [in] | theLength | length of the string to append |
|
inline |
Appends other character to this string.
Example:
| [in] | theOther | the character to append |
|
inline |
Template method for concatenating string literals or char arrays. For safety, uses strlen to get actual string length.
Example:
| [in] | theLiteral | the string literal or char array to concatenate |
| TCollection_AsciiString TCollection_AsciiString::Cat | ( | const double | theOther | ) | const |
Appends other real number to this string.
Example:
| [in] | theOther | the real number to append |
| TCollection_AsciiString TCollection_AsciiString::Cat | ( | const int | theOther | ) | const |
Appends other integer to this string.
Example:
| [in] | theOther | the integer to append |
|
inline |
Appends other string to this string.
Example:
| [in] | theOther | the string to append |
| TCollection_AsciiString TCollection_AsciiString::Cat | ( | const TCollection_ExtendedString & | theOther, |
| const char | theReplaceNonAscii = 0 ) const |
Appends extended string to this string. If theReplaceNonAscii is non-null character, it will be used in place of any non-ASCII character found in the source string. Otherwise, concatenates UTF-8 representation of the source string.
| [in] | theOther | the extended string to append |
| [in] | theReplaceNonAscii | replacement character for non-ASCII characters |
| TCollection_AsciiString TCollection_AsciiString::Cat | ( | const wchar_t * | theStringUtf | ) | const |
Appends wide-char string converted to UTF-8 representation.
| [in] | theStringUtf | the wide character string to append |
Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens.
Example:
| [in] | theWidth | the desired width |
| [in] | theFiller | the character to fill with |
| void TCollection_AsciiString::ChangeAll | ( | const char | theChar, |
| const char | theNewChar, | ||
| const bool | theCaseSensitive = true ) |
Substitutes all the characters equal to aChar by NewChar in this AsciiString. The substitution can be case sensitive. If you don't use default case sensitive, no matter whether aChar is uppercase or not.
Example:
| [in] | theChar | the character to replace |
| [in] | theNewChar | the replacement character |
| [in] | theCaseSensitive | flag indicating case sensitivity |
| void TCollection_AsciiString::Clear | ( | ) |
Removes all characters contained in this string. This produces an empty AsciiString.
Copy C string to this ASCII string. Used as operator =.
| [in] | theCString | the C string to copy from |
Core implementation: Copy string (pointer and length) to this ASCII string. This is the primary implementation that all other Copy overloads redirect to. Used as operator =.
| [in] | theString | pointer to the string to copy from |
| [in] | theLength | length of the string to copy |
Template method for copying string literals or char arrays. For safety, uses strlen to get actual string length.
Example:
| [in] | theLiteral | the string literal or char array to copy from |
|
inline |
Copy fromwhere to this string. Used as operator =.
Example:
|
staticnoexcept |
Returns a const reference to a single shared empty string instance. This method provides access to a static empty string to avoid creating temporary empty strings. Use this method instead of constructing empty strings when you need a const reference.
Example:
| bool TCollection_AsciiString::EndsWith | ( | const char *const | theEndString, |
| const int | theEndLength ) const |
Core implementation: Determines whether the end of this string instance matches the specified string (pointer and length).
| [in] | theEndString | pointer to the string to check for at the end |
| [in] | theEndLength | length of the string to check for |
|
inline |
Template method for checking if string ends with a literal or char array.
| [in] | theLiteral | the string literal or char array to check for at the end |
|
inline |
Determines whether the end of this string instance matches the specified string.
| [in] | theEndString | the string to check for at the end |
| int TCollection_AsciiString::FirstLocationInSet | ( | const char *const | theSet, |
| const int | theSetLength, | ||
| const int | theFromIndex, | ||
| const int | theToIndex ) const |
Core implementation: Returns the index of the first character of this string that is present in the given character set (pointer and length). The search begins at index FromIndex and ends at index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range.
| [in] | theSet | pointer to the set of characters to search for |
| [in] | theSetLength | length of the set |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
|
inline |
Template method for FirstLocationInSet with string literals.
| [in] | theLiteral | the string literal of characters to search for |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
|
inline |
Returns the index of the first character of this string that is present in Set. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range.
Example:
| [in] | theSet | the set of characters to search for |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
| int TCollection_AsciiString::FirstLocationNotInSet | ( | const char *const | theSet, |
| const int | theSetLength, | ||
| const int | theFromIndex, | ||
| const int | theToIndex ) const |
Core implementation: Returns the index of the first character of this string that is not present in the given character set (pointer and length). The search begins at index FromIndex and ends at index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range.
| [in] | theSet | pointer to the set of characters to check against |
| [in] | theSetLength | length of the set |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
|
inline |
Template method for FirstLocationNotInSet with string literals.
| [in] | theLiteral | the string literal of characters to check against |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
|
inline |
Returns the index of the first character of this string that is not present in the set Set. The search begins to the index FromIndex and ends to the the index ToIndex in this string. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range.
Example:
| [in] | theSet | the set of characters to check against |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
|
inline |
Computes a hash code for the given ASCII string Returns the same integer value as the hash function for TCollection_ExtendedString.
Inserts a C string at position theWhere.
| [in] | theWhere | position to insert at |
| [in] | theCString | the C string to insert |
| void TCollection_AsciiString::Insert | ( | const int | theWhere, |
| const char *const | theString, | ||
| const int | theLength ) |
Core implementation: Inserts a string (pointer and length) at position theWhere. This is the primary implementation that all other Insert overloads redirect to.
| [in] | theWhere | position to insert at |
| [in] | theString | pointer to the string to insert |
| [in] | theLength | length of the string to insert |
|
inline |
Template method for inserting string literals with compile-time size deduction. This optimization avoids runtime strlen() calls and unnecessary conversions.
Example:
| [in] | theWhere | the position to insert at |
| [in] | theLiteral | the string literal or char array to insert |
|
inline |
Inserts a AsciiString at position where.
| [in] | theWhere | the position to insert at |
| [in] | theWhat | the ASCII string to insert |
|
inline |
Inserts a C string after a specific index in this string. Raises an exception if index is out of bounds.
| [in] | theIndex | the index to insert after |
| [in] | theCString | the C string to insert |
| void TCollection_AsciiString::InsertAfter | ( | const int | theIndex, |
| const char *const | theString, | ||
| const int | theLength ) |
Core implementation: Inserts string (pointer and length) after a specific index in this string. This is the primary implementation that all other InsertAfter overloads redirect to. Raises an exception if index is out of bounds (less than 0 or greater than the length).
| [in] | theIndex | the index to insert after |
| [in] | theString | pointer to the string to insert |
| [in] | theLength | length of the string to insert |
|
inline |
Template method for inserting string literals or char arrays after a specific index.
| [in] | theIndex | the index to insert after |
| [in] | theLiteral | the string literal or char array to insert |
|
inline |
Inserts an ASCII string after a specific index in this string. Raises an exception if index is out of bounds.
| [in] | theIndex | the index to insert after |
| [in] | theOther | the string to insert |
|
inline |
Inserts a C string before a specific index in this string. Raises an exception if index is out of bounds.
| [in] | theIndex | the index to insert before |
| [in] | theCString | the C string to insert |
| void TCollection_AsciiString::InsertBefore | ( | const int | theIndex, |
| const char *const | theString, | ||
| const int | theLength ) |
Core implementation: Inserts string (pointer and length) before a specific index in this string. This is the primary implementation that all other InsertBefore overloads redirect to. Raises an exception if index is out of bounds (less than 1 or greater than the length).
| [in] | theIndex | the index to insert before |
| [in] | theString | pointer to the string to insert |
| [in] | theLength | length of the string to insert |
|
inline |
Template method for inserting string literals or char arrays before a specific index.
| [in] | theIndex | the index to insert before |
| [in] | theLiteral | the string literal or char array to insert |
|
inline |
Inserts an ASCII string before a specific index in this string. Raises an exception if index is out of bounds.
| [in] | theIndex | the index to insert before |
| [in] | theOther | the string to insert |
| int TCollection_AsciiString::IntegerValue | ( | ) | const |
Converts a AsciiString containing a numeric expression to an Integer.
Example:
| bool TCollection_AsciiString::IsAscii | ( | ) | const |
Returns True if the AsciiString contains only ASCII characters between ' ' and '~'. This means no control character and no extended ASCII code.
Returns true if there are differences between this ASCII string and C string.
| [in] | theCString | the C string to compare with |
|
inline |
Core implementation: Returns true if there are differences between this ASCII string and the string (pointer and length). This is the primary implementation that string_view and CString overloads redirect to.
| [in] | theString | pointer to the string to compare with |
| [in] | theLength | length of the string to compare with |
|
inline |
Template method for comparing difference with string literals or char arrays.
| [in] | theLiteral | the string literal or char array to compare with |
|
inline |
Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=.
| [in] | theOther | the ASCII string to compare with |
|
inline |
Returns True if this string contains zero character.
Returns true if the characters in this ASCII string are identical to the C string.
| [in] | theCString | the C string to compare with |
Core implementation: Returns true if the characters in this ASCII string are identical to the string (pointer and length). This is the primary implementation that string_view and CString overloads redirect to.
| [in] | theString | pointer to the string to compare with |
| [in] | theLength | length of the string to compare with |
|
inline |
Template method for comparing with string literals with compile-time optimization. This optimization avoids runtime strlen() calls and unnecessary conversions.
Example:
| [in] | theLiteral | the string literal or char array to compare with |
|
static |
Returns True when the two strings are the same. (Just for HashCode for AsciiString)
| [in] | string1 | first string to compare |
| [in] | string2 | second C string to compare |
|
inlinestatic |
Returns True when the two strings are the same. (Just for HashCode for AsciiString)
| [in] | string1 | first string to compare |
| [in] | string2 | second string to compare |
|
inline |
Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
| [in] | theOther | the ASCII string to compare with |
Returns TRUE if this string is lexicographically greater than C string.
| [in] | theCString | the C string to compare with |
Core implementation: Returns TRUE if this string is lexicographically greater than the string (pointer and length). This is the primary implementation that all other IsGreater overloads redirect to.
| [in] | theString | pointer to the string to compare with |
| [in] | theLength | length of the string to compare with |
|
inline |
Template method for lexicographic greater comparison with string literals or char arrays.
| [in] | theLiteral | the string literal or char array to compare with |
|
inline |
Returns TRUE if this string is 'ASCII' greater than other.
| [in] | theOther | the ASCII string to compare with |
| bool TCollection_AsciiString::IsIntegerValue | ( | ) | const |
Returns True if the AsciiString contains an integer value. Note: an integer value is considered to be a real value as well.
Returns TRUE if this string is lexicographically less than C string.
| [in] | theCString | the C string to compare with |
Core implementation: Returns TRUE if this string is lexicographically less than the string (pointer and length). This is the primary implementation that all other IsLess overloads redirect to.
| [in] | theString | pointer to the string to compare with |
| [in] | theLength | length of the string to compare with |
|
inline |
Template method for lexicographic comparison with string literals or char arrays.
| [in] | theLiteral | the string literal or char array to compare with |
|
inline |
Returns TRUE if this string is 'ASCII' less than other.
| [in] | theOther | the ASCII string to compare with |
Returns True if the AsciiString starts with some characters that can be interpreted as integer or real value.
| [in] | theToCheckFull | when TRUE, checks if entire string defines a real value; otherwise checks if string starts with a real value Note: an integer value is considered to be a real value as well. |
|
inlinestatic |
Returns True if the C string and string contain same characters.
| [in] | theCString | first C string to compare |
| [in] | theString2 | second string to compare |
| [in] | theIsCaseSensitive | flag indicating case sensitivity |
|
inlinestatic |
Returns True if the two C strings contain same characters.
| [in] | theCString1 | first C string to compare |
| [in] | theCString2 | second C string to compare |
| [in] | theIsCaseSensitive | flag indicating case sensitivity |
|
static |
Core implementation: Returns True if the two strings (pointer and length) contain same characters. This is the primary implementation that all other IsSameString overloads redirect to.
| [in] | theString1 | pointer to first string to compare |
| [in] | theLength1 | length of first string |
| [in] | theString2 | pointer to second string to compare |
| [in] | theLength2 | length of second string |
| [in] | theIsCaseSensitive | flag indicating case sensitivity |
|
inlinestatic |
Returns True if the string and C string contain same characters.
| [in] | theString1 | first string to compare |
| [in] | theCString | second C string to compare |
| [in] | theIsCaseSensitive | flag indicating case sensitivity |
|
inlinestatic |
Returns True if the strings contain same characters.
| [in] | theString1 | first string to compare |
| [in] | theString2 | second string to compare |
| [in] | theIsCaseSensitive | flag indicating case sensitivity |
| void TCollection_AsciiString::LeftAdjust | ( | ) |
Removes all space characters in the beginning of the string.
left justify Length becomes equal to Width and the new characters are equal to Filler. If Width < Length nothing happens. Raises an exception if Width is less than zero.
Example:
| [in] | theWidth | the desired width |
| [in] | theFiller | the character to fill with |
|
inline |
Returns number of characters in this string. This is the same functionality as 'strlen' in C.
Example:
| int TCollection_AsciiString::Location | ( | const int | theN, |
| const char | theC, | ||
| const int | theFromIndex, | ||
| const int | theToIndex ) const |
Returns the index of the nth occurrence of the character C in this string from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range.
Example:
| [in] | theN | the occurrence number to find |
| [in] | theC | the character to search for |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
| int TCollection_AsciiString::Location | ( | const TCollection_AsciiString & | theOther, |
| const int | theFromIndex, | ||
| const int | theToIndex ) const |
Returns an index in this string of the first occurrence of the string S in this string from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range.
Example:
| [in] | theOther | the string to search for |
| [in] | theFromIndex | the starting index for search |
| [in] | theToIndex | the ending index for search |
| void TCollection_AsciiString::LowerCase | ( | ) |
| void TCollection_AsciiString::Move | ( | TCollection_AsciiString && | theOther | ) |
Moves string without reallocations.
| [in] | theOther | the string to move from |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Copy assignment operator.
|
inlinenoexcept |
Move assignment operator.
|
inline |
|
inline |
|
inline |
|
inline |
| void TCollection_AsciiString::Prepend | ( | const TCollection_AsciiString & | theOther | ) |
Inserts the string other at the beginning of this ASCII string.
Example:
| [in] | theOther | the string to prepend |
| void TCollection_AsciiString::Print | ( | Standard_OStream & | theStream | ) | const |
Displays this string on a stream.
| [in] | theStream | the output stream |
| void TCollection_AsciiString::Read | ( | Standard_IStream & | theStream | ) |
Read this string from a stream.
| [in] | theStream | the input stream |
| double TCollection_AsciiString::RealValue | ( | ) | const |
Converts an AsciiString containing a numeric expression to a Real.
Example:
Erases ahowmany characters from position where, where included.
Example:
| [in] | theWhere | the position to start erasing from |
| [in] | theHowMany | the number of characters to erase |
Remove all the occurrences of the character C in the string.
Example:
| [in] | theC | the character to remove |
| [in] | theCaseSensitive | flag indicating case sensitivity |
Removes every what characters from this string.
| [in] | theWhat | the character to remove |
| void TCollection_AsciiString::RightAdjust | ( | ) |
Removes all space characters at the end of the string.
Right justify. Length becomes equal to Width and the new characters are equal to Filler. if Width < Length nothing happens. Raises an exception if Width is less than zero.
Example:
| [in] | theWidth | the desired width |
| [in] | theFiller | the character to fill with |
Searches a C string in this string from the beginning.
| [in] | theCString | the C string to search for |
Core implementation: Searches a string (pointer and length) in this string from the beginning and returns position of first item matching. It returns -1 if not found.
| [in] | theWhat | pointer to the string to search for |
| [in] | theWhatLength | length of the string to search for |
|
inline |
Template method for searching string literals or char arrays.
| [in] | theLiteral | the string literal or char array to search for |
|
inline |
Searches an AsciiString in this string from the beginning and returns position of first item what matching. It returns -1 if not found.
| [in] | theWhat | the ASCII string to search for |
Searches a C string in this string from the end.
| [in] | theCString | the C string to search for |
| int TCollection_AsciiString::SearchFromEnd | ( | const char *const | theWhat, |
| const int | theWhatLength ) const |
Core implementation: Searches a string (pointer and length) in this string from the end and returns position of first item matching. It returns -1 if not found.
| [in] | theWhat | pointer to the string to search for |
| [in] | theWhatLength | length of the string to search for |
|
inline |
Template method for searching string literals or char arrays from end.
| [in] | theLiteral | the string literal or char array to search for |
|
inline |
Searches a AsciiString in another AsciiString from the end and returns position of first item what matching. It returns -1 if not found.
| [in] | theWhat | the ASCII string to search for |
Replaces a part of this ASCII string with a C string.
| [in] | theWhere | position to start replacement |
| [in] | theCString | the C string to replace with |
| void TCollection_AsciiString::SetValue | ( | const int | theWhere, |
| const char *const | theString, | ||
| const int | theLength ) |
Core implementation: Replaces a part of this string with a string (pointer and length). This is the primary implementation that all other SetValue string overloads redirect to.
| [in] | theWhere | position to start replacement |
| [in] | theString | pointer to the string to replace with |
| [in] | theLength | length of the string to replace with |
Replaces one character in the AsciiString at position where. If where is less than zero or greater than the length of this string an exception is raised.
Example:
| [in] | theWhere | the position to replace at |
| [in] | theWhat | the character to replace with |
|
inline |
Replaces a part of this string by another AsciiString.
| [in] | theWhere | the position to start replacement |
| [in] | theWhat | the ASCII string to replace with |
| TCollection_AsciiString TCollection_AsciiString::Split | ( | const int | theWhere | ) |
Splits a AsciiString into two sub-strings.
Example:
| [in] | theWhere | the position to split at |
Determines whether the beginning of this string matches the specified C string.
| [in] | theCString | the C string to check for at the beginning |
| bool TCollection_AsciiString::StartsWith | ( | const char *const | theStartString, |
| const int | theStartLength ) const |
Core implementation: Determines whether the beginning of this string instance matches the specified string (pointer and length).
| [in] | theStartString | pointer to the string to check for at the beginning |
| [in] | theStartLength | length of the string to check for |
|
inline |
Template method for checking if string starts with a literal or char array.
| [in] | theLiteral | the string literal or char array to check for at the beginning |
|
inline |
Determines whether the beginning of this string instance matches the specified string.
| [in] | theStartString | the string to check for at the beginning |
| TCollection_AsciiString TCollection_AsciiString::SubString | ( | const int | theFromIndex, |
| const int | theToIndex ) const |
Creation of a sub-string of this string. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds.
Example:
| [in] | theFromIndex | the starting index |
| [in] | theToIndex | the ending index |
| void TCollection_AsciiString::Swap | ( | TCollection_AsciiString & | theOther | ) |
Exchange the data of two strings (without reallocating memory).
| [in,out] | theOther | the string to exchange data with |
|
inline |
Returns pointer to AsciiString (char *). This is useful for some casual manipulations. Warning: Because this "char *" is 'const', you can't modify its contents.
| TCollection_AsciiString TCollection_AsciiString::Token | ( | const char *const | theSeparators = " \t", |
| const int | theWhichOne = 1 ) const |
Extracts whichone token from this string. By default, the separators is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). separators contains all separators you need. If no token indexed by whichone is found, it returns empty AsciiString.
Example:
| [in] | theSeparators | the separator characters |
| [in] | theWhichOne | the token number to extract |
Truncates this string to ahowmany characters.
Example:
| [in] | theHowMany | the number of characters to keep |
| void TCollection_AsciiString::UpperCase | ( | ) |
Converts this string to its upper-case equivalent.
| int TCollection_AsciiString::UsefullLength | ( | ) | const |
Length of the string ignoring all spaces (' ') and the control character at the end.
Returns character at position where in this string. If where is less than zero or greater than the length of this string, an exception is raised.
Example:
| [in] | theWhere | the position to get character from |