UDK 3.2.7 C/C++ API Reference
|
This String class provide base functionality for C++ like 8-Bit character array handling. More...
#include <string.hxx>
Public Member Functions | |
OString () throw () | |
New string containing no characters. | |
OString (const OString &str) throw () | |
New string from OString. | |
OString (rtl_String *str) throw () | |
New string from OString data. | |
OString (rtl_String *str, __sal_NoAcquire) throw () | |
New string from OString data without acquiring it. | |
OString (sal_Char value) throw () | |
New string from a single character. | |
template<typename T > | |
OString (const T &value, typename internal::CharPtrDetector< T, internal::Dummy >::Type=internal::Dummy()) throw () | |
New string from a character buffer array. | |
template<typename T > | |
OString (T &value, typename internal::NonConstCharArrayDetector< T, internal::Dummy >::Type=internal::Dummy()) throw () | |
template<typename T > | |
OString (T &literal, typename internal::ConstCharArrayDetector< T, internal::Dummy >::Type=internal::Dummy()) throw () | |
New string from a string literal. | |
OString (const sal_Char *value, sal_Int32 length) throw () | |
New string from a character buffer array. | |
OString (const sal_Unicode *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OUSTRING_TO_OSTRING_CVTFLAGS) | |
New string from a Unicode character buffer array. | |
~OString () throw () | |
Release the string data. | |
OString & | operator= (const OString &str) throw () |
Assign a new string. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, OString & >::Type | operator= (T &literal) throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
OString & | operator+= (const OString &str) throw () |
Append a string to this string. | |
sal_Int32 | getLength () const throw () |
Returns the length of this string. | |
bool | isEmpty () const throw () |
Checks if a string is empty. | |
const sal_Char * | getStr () const throw () |
Returns a pointer to the characters of this string. | |
sal_Char | operator[] (sal_Int32 index) const |
Access to individual characters. | |
sal_Int32 | compareTo (const OString &str) const throw () |
Compares two strings. | |
sal_Int32 | compareTo (const OString &rObj, sal_Int32 maxLength) const throw () |
Compares two strings with an maximum count of characters. | |
sal_Int32 | reverseCompareTo (const OString &str) const throw () |
Compares two strings in reverse order. | |
sal_Bool | equals (const OString &str) const throw () |
Perform a comparison of two strings. | |
sal_Bool | equalsL (const sal_Char *value, sal_Int32 length) const throw () |
Perform a comparison of two strings. | |
sal_Bool | equalsIgnoreAsciiCase (const OString &str) const throw () |
Perform a ASCII lowercase comparison of two strings. | |
template<typename T > | |
internal::CharPtrDetector< T, bool >::Type | equalsIgnoreAsciiCase (const T &asciiStr) const throw () |
Perform a ASCII lowercase comparison of two strings. | |
template<typename T > | |
internal::NonConstCharArrayDetector < T, bool >::Type | equalsIgnoreAsciiCase (T &asciiStr) const throw () |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | equalsIgnoreAsciiCase (T &literal) const throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
sal_Bool | equalsIgnoreAsciiCaseL (const sal_Char *asciiStr, sal_Int32 asciiStrLength) const throw () |
Perform a ASCII lowercase comparison of two strings. | |
sal_Bool | match (const OString &str, sal_Int32 fromIndex=0) const throw () |
Match against a substring appearing in this string. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | match (T &literal, sal_Int32 fromIndex=0) const throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
bool | matchL (char const *str, sal_Int32 strLength, sal_Int32 fromIndex=0) const |
Match against a substring appearing in this string. | |
sal_Bool | matchIgnoreAsciiCase (const OString &str, sal_Int32 fromIndex=0) const throw () |
Match against a substring appearing in this string, ignoring the case of ASCII letters. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | matchIgnoreAsciiCase (T &literal, sal_Int32 fromIndex=0) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
bool | endsWith (OString const &str) const |
Check whether this string ends with a given substring. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | endsWith (T &literal) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
bool | endsWithL (char const *str, sal_Int32 strLength) const |
Check whether this string ends with a given substring. | |
sal_Int32 | hashCode () const throw () |
Returns a hashcode for this string. | |
sal_Int32 | indexOf (sal_Char ch, sal_Int32 fromIndex=0) const throw () |
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. | |
sal_Int32 | lastIndexOf (sal_Char ch) const throw () |
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the end. | |
sal_Int32 | lastIndexOf (sal_Char ch, sal_Int32 fromIndex) const throw () |
Returns the index within this string of the last occurrence of the specified character, searching backward starting before the specified index. | |
sal_Int32 | indexOf (const OString &str, sal_Int32 fromIndex=0) const throw () |
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, sal_Int32 >::Type | indexOf (T &literal, sal_Int32 fromIndex=0) const throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
sal_Int32 | indexOfL (char const *str, sal_Int32 len, sal_Int32 fromIndex=0) const throw () |
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. | |
sal_Int32 | lastIndexOf (const OString &str) const throw () |
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end. | |
sal_Int32 | lastIndexOf (const OString &str, sal_Int32 fromIndex) const throw () |
Returns the index within this string of the last occurrence of the specified substring, searching backward starting before the specified index. | |
OString | copy (sal_Int32 beginIndex) const throw () |
Returns a new string that is a substring of this string. | |
OString | copy (sal_Int32 beginIndex, sal_Int32 count) const throw () |
Returns a new string that is a substring of this string. | |
OString | concat (const OString &str) const throw () |
Concatenates the specified string to the end of this string. | |
OString | replaceAt (sal_Int32 index, sal_Int32 count, const OString &newStr) const throw () |
Returns a new string resulting from replacing n = count characters from position index in this string with newStr. | |
OString | replace (sal_Char oldChar, sal_Char newChar) const throw () |
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar. | |
OString | replaceFirst (OString const &from, OString const &to, sal_Int32 *index=0) const |
Returns a new string resulting from replacing the first occurrence of a given substring with another substring. | |
OString | replaceAll (OString const &from, OString const &to) const |
Returns a new string resulting from replacing all occurrences of a given substring with another substring. | |
OString | toAsciiLowerCase () const throw () |
Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-122). | |
OString | toAsciiUpperCase () const throw () |
Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-90). | |
OString | trim () const throw () |
Returns a new string resulting from removing white space from both ends of the string. | |
OString | getToken (sal_Int32 token, sal_Char cTok, sal_Int32 &index) const throw () |
Returns a token in the string. | |
OString | getToken (sal_Int32 count, char separator) const |
Returns a token from the string. | |
sal_Bool | toBoolean () const throw () |
Returns the Boolean value from this string. | |
sal_Char | toChar () const throw () |
Returns the first character from this string. | |
sal_Int32 | toInt32 (sal_Int16 radix=10) const throw () |
Returns the int32 value from this string. | |
sal_Int64 | toInt64 (sal_Int16 radix=10) const throw () |
Returns the int64 value from this string. | |
float | toFloat () const throw () |
Returns the float value from this string. | |
double | toDouble () const throw () |
Returns the double value from this string. | |
Static Public Member Functions | |
static OString | valueOf (sal_Bool b) throw () |
Returns the string representation of the sal_Bool argument. | |
static OString | valueOf (sal_Char c) throw () |
Returns the string representation of the char argument. | |
static OString | valueOf (sal_Int32 i, sal_Int16 radix=10) throw () |
Returns the string representation of the int argument. | |
static OString | valueOf (sal_Int64 ll, sal_Int16 radix=10) throw () |
Returns the string representation of the long argument. | |
static OString | valueOf (float f) throw () |
Returns the string representation of the float argument. | |
static OString | valueOf (double d) throw () |
Returns the string representation of the double argument. | |
Friends | |
sal_Bool | operator== (const OString &rStr1, const OString &rStr2) throw () |
sal_Bool | operator!= (const OString &rStr1, const OString &rStr2) throw () |
sal_Bool | operator< (const OString &rStr1, const OString &rStr2) throw () |
sal_Bool | operator> (const OString &rStr1, const OString &rStr2) throw () |
sal_Bool | operator<= (const OString &rStr1, const OString &rStr2) throw () |
sal_Bool | operator>= (const OString &rStr1, const OString &rStr2) throw () |
template<typename T > | |
internal::CharPtrDetector< T, bool >::Type | operator== (const OString &rStr1, const T &value) throw () |
template<typename T > | |
internal::NonConstCharArrayDetector < T, bool >::Type | operator== (const OString &rStr1, T &value) throw () |
template<typename T > | |
internal::CharPtrDetector< T, bool >::Type | operator== (const T &value, const OString &rStr2) throw () |
template<typename T > | |
internal::NonConstCharArrayDetector < T, bool >::Type | operator== (T &value, const OString &rStr2) throw () |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | operator== (const OString &rStr, T &literal) throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | operator== (T &literal, const OString &rStr) throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
template<typename T > | |
internal::CharPtrDetector< T, bool >::Type | operator!= (const OString &rStr1, const T &value) throw () |
template<typename T > | |
internal::NonConstCharArrayDetector < T, bool >::Type | operator!= (const OString &rStr1, T &value) throw () |
template<typename T > | |
internal::CharPtrDetector< T, bool >::Type | operator!= (const T &value, const OString &rStr2) throw () |
template<typename T > | |
internal::NonConstCharArrayDetector < T, bool >::Type | operator!= (T &value, const OString &rStr2) throw () |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | operator!= (const OString &rStr, T &literal) throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
template<typename T > | |
internal::ConstCharArrayDetector < T, bool >::Type | operator!= (T &literal, const OString &rStr) throw () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. | |
OString | operator+ (const OString &str1, const OString &str2) throw () |
This String class provide base functionality for C++ like 8-Bit character array handling.
The advantage of this class is, that it handle all the memory managament for you - and it do it more efficient. If you assign a string to another string, the data of both strings are shared (without any copy operation or memory allocation) as long as you do not change the string. This class stores also the length of the string, so that many operations are faster as the C-str-functions.
This class provide only readonly string handling. So you could create a string and you could only query the content from this string. It provide also functionality to change the string, but this results in every case in a new string instance (in the most cases with an memory allocation). You don't have functionality to change the content of the string. If you want change the string content, than you should us the OStringBuffer class, which provide these functionality and avoid to much memory allocation.
The design of this class is similar to the string classes in Java and so more people should have fewer understanding problems when they use this class.
rtl::OString::OString | ( | ) | throw () [inline] |
New string containing no characters.
rtl::OString::OString | ( | const OString & | str | ) | throw () [inline] |
rtl::OString::OString | ( | rtl_String * | str | ) | throw () [inline] |
rtl::OString::OString | ( | rtl_String * | str, |
__sal_NoAcquire | |||
) | throw () [inline] |
rtl::OString::OString | ( | sal_Char | value | ) | throw () [inline, explicit] |
New string from a single character.
value | a character. |
rtl::OString::OString | ( | const T & | value, |
typename internal::CharPtrDetector< T, internal::Dummy >::Type | = internal::Dummy() |
||
) | throw () [inline] |
New string from a character buffer array.
Note: The argument type is always either char* or const char*. The template is used only for technical reasons, as is the second argument.
value | a NULL-terminated character array. |
rtl::OString::OString | ( | T & | value, |
typename internal::NonConstCharArrayDetector< T, internal::Dummy >::Type | = internal::Dummy() |
||
) | throw () [inline] |
rtl::OString::OString | ( | T & | literal, |
typename internal::ConstCharArrayDetector< T, internal::Dummy >::Type | = internal::Dummy() |
||
) | throw () [inline] |
New string from a string literal.
If there are any embedded \0's in the string literal, the result is undefined. Use the overload that explicitly accepts length.
literal | a string literal |
rtl::OString::OString | ( | const sal_Char * | value, |
sal_Int32 | length | ||
) | throw () [inline] |
New string from a character buffer array.
value | a character array. |
length | the number of character which should be copied. The character array length must be greater or equal than this value. |
rtl::OString::OString | ( | const sal_Unicode * | value, |
sal_Int32 | length, | ||
rtl_TextEncoding | encoding, | ||
sal_uInt32 | convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS |
||
) | [inline] |
New string from a Unicode character buffer array.
value | a Unicode character array. |
length | the number of character which should be converted. The Unicode character array length must be greater or equal than this value. |
encoding | the text encoding in which the Unicode character sequence should be converted. |
convertFlags | flags which controls the conversion. see RTL_UNICODETOTEXT_FLAGS_... |
std::bad_alloc | is thrown if an out-of-memory condition occurs |
rtl::OString::~OString | ( | ) | throw () [inline] |
Release the string data.
sal_Int32 rtl::OString::compareTo | ( | const OString & | str | ) | const throw () [inline] |
Compares two strings.
The comparison is based on the numeric value of each character in the strings and return a value indicating their relationship. This function can't be used for language specific sorting.
str | the object to be compared. |
sal_Int32 rtl::OString::compareTo | ( | const OString & | rObj, |
sal_Int32 | maxLength | ||
) | const throw () [inline] |
Compares two strings with an maximum count of characters.
The comparison is based on the numeric value of each character in the strings and return a value indicating their relationship. This function can't be used for language specific sorting.
rObj | the object to be compared. |
maxLength | the maximum count of characters to be compared. |
Concatenates the specified string to the end of this string.
str | the string that is concatenated to the end of this string. |
OString rtl::OString::copy | ( | sal_Int32 | beginIndex | ) | const throw () [inline] |
Returns a new string that is a substring of this string.
The substring begins at the specified beginIndex. It is an error for beginIndex to be negative or to be greater than the length of this string.
beginIndex | the beginning index, inclusive. |
OString rtl::OString::copy | ( | sal_Int32 | beginIndex, |
sal_Int32 | count | ||
) | const throw () [inline] |
Returns a new string that is a substring of this string.
The substring begins at the specified beginIndex and contains count characters. It is an error for either beginIndex or count to be negative, or for beginIndex + count to be greater than the length of this string.
beginIndex | the beginning index, inclusive. |
count | the number of characters. |
bool rtl::OString::endsWith | ( | OString const & | str | ) | const [inline] |
Check whether this string ends with a given substring.
str | the substring to be compared |
internal::ConstCharArrayDetector< T, bool >::Type rtl::OString::endsWith | ( | T & | literal | ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
bool rtl::OString::endsWithL | ( | char const * | str, |
sal_Int32 | strLength | ||
) | const [inline] |
Check whether this string ends with a given substring.
str | the substring to be compared; must not be null and must point to memory of at least strLength bytes |
strLength | the length of the substring; must be non-negative |
Perform a comparison of two strings.
The result is true if and only if second string represents the same sequence of characters as the first string. This function can't be used for language specific comparison.
str | the object to be compared. |
internal::ConstCharArrayDetector< T, bool >::Type rtl::OString::equalsIgnoreAsciiCase | ( | T & | literal | ) | const throw () [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
Perform a ASCII lowercase comparison of two strings.
The result is true if and only if second string represents the same sequence of characters as the first string, ignoring the case. Character values between 65 and 90 (ASCII A-Z) are interpreted as values between 97 and 122 (ASCII a-z). This function can't be used for language specific comparison.
str | the object to be compared. |
internal::CharPtrDetector< T, bool >::Type rtl::OString::equalsIgnoreAsciiCase | ( | const T & | asciiStr | ) | const throw () [inline] |
Perform a ASCII lowercase comparison of two strings.
The result is true if and only if second string represents the same sequence of characters as the first string, ignoring the case. Character values between 65 and 90 (ASCII A-Z) are interpreted as values between 97 and 122 (ASCII a-z). Since this method is optimized for performance, the ASCII character values are not converted in any way. The caller has to make sure that all ASCII characters are in the allowed range between 0 and 127. The ASCII string must be NULL-terminated. This function can't be used for language specific comparison.
Note: The argument type is always either char* or const char*, the return type is bool. The template is used only for technical reasons.
asciiStr | the 8-Bit ASCII character string to be compared. |
internal::NonConstCharArrayDetector< T, bool >::Type rtl::OString::equalsIgnoreAsciiCase | ( | T & | asciiStr | ) | const throw () [inline] |
sal_Bool rtl::OString::equalsIgnoreAsciiCaseL | ( | const sal_Char * | asciiStr, |
sal_Int32 | asciiStrLength | ||
) | const throw () [inline] |
Perform a ASCII lowercase comparison of two strings.
The result is true if and only if second string represents the same sequence of characters as the first string, ignoring the case. Character values between 65 and 90 (ASCII A-Z) are interpreted as values between 97 and 122 (ASCII a-z). Since this method is optimized for performance, the ASCII character values are not converted in any way. The caller has to make sure that all ASCII characters are in the allowed range between 0 and 127. The ASCII string must be greater or equal in length as asciiStrLength. This function can't be used for language specific comparison.
asciiStr | the 8-Bit ASCII character string to be compared. |
asciiStrLength | the length of the ascii string |
Perform a comparison of two strings.
The result is true if and only if second string represents the same sequence of characters as the first string. The ASCII string must be NULL-terminated and must be greater or equal as length. This function can't be used for language specific comparison.
value | a character array. |
length | the length of the character array. |
sal_Int32 rtl::OString::getLength | ( | ) | const throw () [inline] |
Returns the length of this string.
The length is equal to the number of characters in this string.
const sal_Char* rtl::OString::getStr | ( | ) | const throw () [inline] |
Returns a pointer to the characters of this string.
The returned pointer is guaranteed to point to a null-terminated byte string. But note that this string object may contain embedded null characters, which will thus also be embedded in the returned null-terminated byte string.
OString rtl::OString::getToken | ( | sal_Int32 | token, |
sal_Char | cTok, | ||
sal_Int32 & | index | ||
) | const throw () [inline] |
Returns a token in the string.
Example: sal_Int32 nIndex = 0; do { ... OString aToken = aStr.getToken( 0, ';', nIndex ); ... } while ( nIndex >= 0 );
token | the number of the token to return. |
cTok | the character which seperate the tokens. |
index | the position at which the token is searched in the string. The index must not be greater thanthe length of the string. This param is set to the position of the next token or to -1, if it is the last token. |
OString rtl::OString::getToken | ( | sal_Int32 | count, |
char | separator | ||
) | const [inline] |
Returns a token from the string.
The same as getToken(sal_Int32, sal_Char, sal_Int32 &), but always passing in 0 as the start index in the third argument.
count | the number of the token to return, starting with 0 |
separator | the character which separates the tokens |
sal_Int32 rtl::OString::hashCode | ( | ) | const throw () [inline] |
Returns a hashcode for this string.
sal_Int32 rtl::OString::indexOf | ( | sal_Char | ch, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
ch | character to be located. |
fromIndex | the index to start the search from. The index must be greater or equal than 0 and less or equal as the string length. |
sal_Int32 rtl::OString::indexOf | ( | const OString & | str, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
If str doesn't include any character, always -1 is returned. This is also the case, if both strings are empty.
str | the substring to search for. |
fromIndex | the index to start the search from. |
internal::ConstCharArrayDetector< T, sal_Int32 >::Type rtl::OString::indexOf | ( | T & | literal, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
sal_Int32 rtl::OString::indexOfL | ( | char const * | str, |
sal_Int32 | len, | ||
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
If str doesn't include any character, always -1 is returned. This is also the case, if both strings are empty.
str | the substring to search for. |
len | the length of the substring. |
fromIndex | the index to start the search from. |
bool rtl::OString::isEmpty | ( | ) | const throw () [inline] |
Checks if a string is empty.
sal_Int32 rtl::OString::lastIndexOf | ( | const OString & | str | ) | const throw () [inline] |
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end.
The returned index indicates the starting index of the substring in this string. If str doesn't include any character, always -1 is returned. This is also the case, if both strings are empty.
str | the substring to search for. |
sal_Int32 rtl::OString::lastIndexOf | ( | const OString & | str, |
sal_Int32 | fromIndex | ||
) | const throw () [inline] |
Returns the index within this string of the last occurrence of the specified substring, searching backward starting before the specified index.
The returned index indicates the starting index of the substring in this string. If str doesn't include any character, always -1 is returned. This is also the case, if both strings are empty.
str | the substring to search for. |
fromIndex | the index before which to start the search. |
sal_Int32 rtl::OString::lastIndexOf | ( | sal_Char | ch | ) | const throw () [inline] |
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the end.
ch | character to be located. |
sal_Int32 rtl::OString::lastIndexOf | ( | sal_Char | ch, |
sal_Int32 | fromIndex | ||
) | const throw () [inline] |
Returns the index within this string of the last occurrence of the specified character, searching backward starting before the specified index.
ch | character to be located. |
fromIndex | the index before which to start the search. |
sal_Bool rtl::OString::match | ( | const OString & | str, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
Match against a substring appearing in this string.
The result is true if and only if the second string appears as a substring of this string, at the given position. This function can't be used for language specific comparison.
str | the object (substring) to be compared. |
fromIndex | the index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length. |
internal::ConstCharArrayDetector< T, bool >::Type rtl::OString::match | ( | T & | literal, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
sal_Bool rtl::OString::matchIgnoreAsciiCase | ( | const OString & | str, |
sal_Int32 | fromIndex = 0 |
||
) | const throw () [inline] |
Match against a substring appearing in this string, ignoring the case of ASCII letters.
The result is true if and only if the second string appears as a substring of this string, at the given position. Character values between 65 and 90 (ASCII A-Z) are interpreted as values between 97 and 122 (ASCII a-z). This function can't be used for language specific comparison.
str | the object (substring) to be compared. |
fromIndex | the index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length. |
internal::ConstCharArrayDetector< T, bool >::Type rtl::OString::matchIgnoreAsciiCase | ( | T & | literal, |
sal_Int32 | fromIndex = 0 |
||
) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
bool rtl::OString::matchL | ( | char const * | str, |
sal_Int32 | strLength, | ||
sal_Int32 | fromIndex = 0 |
||
) | const [inline] |
Match against a substring appearing in this string.
str | the substring to be compared; must not be null and must point to memory of at least strLength bytes |
strLength | the length of the substring; must be non-negative |
fromIndex | the index into this string to start the comparison at; must be non-negative and not greater than this string's length |
Append a string to this string.
str | a OString. |
internal::ConstCharArrayDetector< T, OString& >::Type rtl::OString::operator= | ( | T & | literal | ) | throw () [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
Assign a new string.
str | a OString. |
sal_Char rtl::OString::operator[] | ( | sal_Int32 | index | ) | const [inline] |
Access to individual characters.
index | must be non-negative and less than length. |
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
If the character oldChar does not occur in the character sequence represented by this object, then the string is assigned with str.
oldChar | the old character. |
newChar | the new character. |
Returns a new string resulting from replacing all occurrences of a given substring with another substring.
Replacing subsequent occurrences picks up only after a given replacement. That is, replacing from "xa" to "xx" in "xaa" results in "xxa", not "xxx".
from | the substring to be replaced |
to | the replacing substring |
OString rtl::OString::replaceAt | ( | sal_Int32 | index, |
sal_Int32 | count, | ||
const OString & | newStr | ||
) | const throw () [inline] |
Returns a new string resulting from replacing n = count characters from position index in this string with newStr.
index | the replacing index in str. The index must be greater or equal as 0 and less or equal as the length of the string. |
count | the count of charcters that will replaced The count must be greater or equal as 0 and less or equal as the length of the string minus index. |
newStr | the new substring. |
OString rtl::OString::replaceFirst | ( | OString const & | from, |
OString const & | to, | ||
sal_Int32 * | index = 0 |
||
) | const [inline] |
Returns a new string resulting from replacing the first occurrence of a given substring with another substring.
from | the substring to be replaced | |
to | the replacing substring | |
[in,out] | index | pointer to a start index; if the pointer is non-null: upon entry to the function, its value is the index into the this string at which to start searching for the from substring, the value must be non-negative and not greater than this string's length; upon exit from the function its value is the index into this string at which the replacement took place or -1 if no replacement took place; if the pointer is null, searching always starts at index 0 |
sal_Int32 rtl::OString::reverseCompareTo | ( | const OString & | str | ) | const throw () [inline] |
Compares two strings in reverse order.
The comparison is based on the numeric value of each character in the strings and return a value indicating their relationship. This function can't be used for language specific sorting.
str | the object to be compared. |
OString rtl::OString::toAsciiLowerCase | ( | ) | const throw () [inline] |
Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-122).
This function can't be used for language specific conversion. If the string doesn't contain characters which must be converted, then the new string is assigned with str.
OString rtl::OString::toAsciiUpperCase | ( | ) | const throw () [inline] |
Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-90).
This function can't be used for language specific conversion. If the string doesn't contain characters which must be converted, then the new string is assigned with str.
sal_Bool rtl::OString::toBoolean | ( | ) | const throw () [inline] |
Returns the Boolean value from this string.
This function can't be used for language specific conversion.
sal_Char rtl::OString::toChar | ( | ) | const throw () [inline] |
Returns the first character from this string.
double rtl::OString::toDouble | ( | ) | const throw () [inline] |
Returns the double value from this string.
This function can't be used for language specific conversion.
float rtl::OString::toFloat | ( | ) | const throw () [inline] |
Returns the float value from this string.
This function can't be used for language specific conversion.
sal_Int32 rtl::OString::toInt32 | ( | sal_Int16 | radix = 10 | ) | const throw () [inline] |
Returns the int32 value from this string.
This function can't be used for language specific conversion.
radix | the radix (between 2 and 36) |
sal_Int64 rtl::OString::toInt64 | ( | sal_Int16 | radix = 10 | ) | const throw () [inline] |
Returns the int64 value from this string.
This function can't be used for language specific conversion.
radix | the radix (between 2 and 36) |
OString rtl::OString::trim | ( | ) | const throw () [inline] |
Returns a new string resulting from removing white space from both ends of the string.
All characters that have codes less than or equal to 32 (the space character) are considered to be white space. If the string doesn't contain white spaces at both ends, then the new string is assigned with str.
Returns the string representation of the sal_Bool argument.
If the sal_Bool is true, the string "true" is returned. If the sal_Bool is false, the string "false" is returned. This function can't be used for language specific conversion.
b | a sal_Bool. |
static OString rtl::OString::valueOf | ( | sal_Int32 | i, |
sal_Int16 | radix = 10 |
||
) | throw () [inline, static] |
Returns the string representation of the int argument.
This function can't be used for language specific conversion.
i | a int32. |
radix | the radix (between 2 and 36) |
static OString rtl::OString::valueOf | ( | sal_Int64 | ll, |
sal_Int16 | radix = 10 |
||
) | throw () [inline, static] |
Returns the string representation of the long argument.
This function can't be used for language specific conversion.
ll | a int64. |
radix | the radix (between 2 and 36) |
static OString rtl::OString::valueOf | ( | double | d | ) | throw () [inline, static] |
Returns the string representation of the double argument.
This function can't be used for language specific conversion.
d | a double. |
static OString rtl::OString::valueOf | ( | float | f | ) | throw () [inline, static] |
Returns the string representation of the float argument.
This function can't be used for language specific conversion.
f | a float. |
Returns the string representation of the char argument.
c | a character. |
internal::NonConstCharArrayDetector< T, bool >::Type operator!= | ( | T & | value, |
const OString & | rStr2 | ||
) | throw () [friend] |
internal::ConstCharArrayDetector< T, bool >::Type operator!= | ( | const OString & | rStr, |
T & | literal | ||
) | throw () [friend] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
internal::ConstCharArrayDetector< T, bool >::Type operator!= | ( | T & | literal, |
const OString & | rStr | ||
) | throw () [friend] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
internal::CharPtrDetector< T, bool >::Type operator!= | ( | const OString & | rStr1, |
const T & | value | ||
) | throw () [friend] |
internal::NonConstCharArrayDetector< T, bool >::Type operator!= | ( | const OString & | rStr1, |
T & | value | ||
) | throw () [friend] |
internal::CharPtrDetector< T, bool >::Type operator!= | ( | const T & | value, |
const OString & | rStr2 | ||
) | throw () [friend] |
internal::NonConstCharArrayDetector< T, bool >::Type operator== | ( | T & | value, |
const OString & | rStr2 | ||
) | throw () [friend] |
internal::CharPtrDetector< T, bool >::Type operator== | ( | const T & | value, |
const OString & | rStr2 | ||
) | throw () [friend] |
internal::ConstCharArrayDetector< T, bool >::Type operator== | ( | const OString & | rStr, |
T & | literal | ||
) | throw () [friend] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.
internal::CharPtrDetector< T, bool >::Type operator== | ( | const OString & | rStr1, |
const T & | value | ||
) | throw () [friend] |
internal::NonConstCharArrayDetector< T, bool >::Type operator== | ( | const OString & | rStr1, |
T & | value | ||
) | throw () [friend] |
internal::ConstCharArrayDetector< T, bool >::Type operator== | ( | T & | literal, |
const OString & | rStr | ||
) | throw () [friend] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.