UDK 3.2.7 C/C++ API Reference
Classes | Public Member Functions | Static Public Member Functions | Friends
rtl::OUString Class Reference

This String class provide base functionality for C++ like Unicode character array handling. More...

#include <ustring.hxx>

List of all members.

Classes

class  DO_NOT_ACQUIRE

Public Member Functions

 OUString () throw ()
 New string containing no characters.
 OUString (const OUString &str) throw ()
 New string from OUString.
 OUString (rtl_uString *str) throw ()
 New string from OUString data.
 OUString (rtl_uString *str, __sal_NoAcquire) throw ()
 New OUString from OUString data without acquiring it.
 OUString (sal_Unicode value) throw ()
 New string from a single Unicode character.
 OUString (const sal_Unicode *value) throw ()
 New string from a Unicode character buffer array.
 OUString (const sal_Unicode *value, sal_Int32 length) throw ()
 New string from a Uniocde character buffer array.
template<typename T >
 OUString (T &literal, typename internal::ConstCharArrayDetector< T, internal::Dummy >::Type=internal::Dummy())
 New string from an 8-Bit string literal that is expected to contain only characters in the ASCII set (i.e.
 OUString (const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS)
 New string from a 8-Bit character buffer array.
 OUString (sal_uInt32 const *codePoints, sal_Int32 codePointCount)
 Create a new string from an array of Unicode code points.
 ~OUString () throw ()
 Release the string data.
OUStringoperator= (const OUString &str) throw ()
 Assign a new string.
template<typename T >
internal::ConstCharArrayDetector
< T, OUString & >::Type 
operator= (T &literal)
 Assign a new string from an 8-Bit string literal that is expected to contain only characters in the ASCII set (i.e.
OUStringoperator+= (const OUString &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_UnicodegetStr () const throw ()
 Returns a pointer to the Unicode character buffer from this string.
sal_Unicode operator[] (sal_Int32 index) const
 Access to individual characters.
sal_Int32 compareTo (const OUString &str) const throw ()
 Compares two strings.
sal_Int32 compareTo (const OUString &str, sal_Int32 maxLength) const throw ()
 Compares two strings with an maximum count of characters.
sal_Int32 reverseCompareTo (const OUString &str) const throw ()
 Compares two strings in reverse order.
sal_Bool equals (const OUString &str) const throw ()
 Perform a comparison of two strings.
sal_Bool equalsIgnoreAsciiCase (const OUString &str) const throw ()
 Perform a ASCII lowercase comparison of two strings.
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 match (const OUString &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.
sal_Bool matchIgnoreAsciiCase (const OUString &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 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 compareToAscii (const sal_Char *asciiStr) const throw ()
 Compares two strings.
sal_Int32 compareToAscii (const sal_Char *asciiStr, sal_Int32 maxLength) const throw ()
 Compares two strings with an maximum count of characters.
sal_Int32 reverseCompareToAsciiL (const sal_Char *asciiStr, sal_Int32 asciiStrLength) const throw ()
 Compares two strings in reverse order.
sal_Bool equalsAscii (const sal_Char *asciiStr) const throw ()
 Perform a comparison of two strings.
sal_Bool equalsAsciiL (const sal_Char *asciiStr, sal_Int32 asciiStrLength) const throw ()
 Perform a comparison of two strings.
sal_Bool equalsIgnoreAsciiCaseAscii (const sal_Char *asciiStr) const throw ()
 Perform a ASCII lowercase comparison of two strings.
sal_Int32 compareToIgnoreAsciiCaseAscii (const sal_Char *asciiStr) const throw ()
 Compares two ASCII strings ignoring case.
sal_Bool equalsIgnoreAsciiCaseAsciiL (const sal_Char *asciiStr, sal_Int32 asciiStrLength) const throw ()
 Perform a ASCII lowercase comparison of two strings.
sal_Bool matchAsciiL (const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const throw ()
 Match against a substring appearing in this string.
sal_Bool matchIgnoreAsciiCaseAsciiL (const sal_Char *asciiStr, sal_Int32 asciiStrLength, sal_Int32 fromIndex=0) const throw ()
 Match against a substring appearing in this string, ignoring the case of ASCII letters.
bool endsWith (OUString 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 endsWithAsciiL (char const *asciiStr, sal_Int32 asciiStrLength) const
 Check whether this string ends with a given ASCII string.
sal_Bool endsWithIgnoreAsciiCase (const OUString &str) const throw ()
 Check whether this string ends with a given string, ignoring the case of ASCII letters.
template<typename T >
internal::ConstCharArrayDetector
< T, bool >::Type 
endsWithIgnoreAsciiCase (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.
bool endsWithIgnoreAsciiCaseAsciiL (char const *asciiStr, sal_Int32 asciiStrLength) const
 Check whether this string ends with a given ASCII string, ignoring the case of ASCII letters.
sal_Int32 hashCode () const throw ()
 Returns a hashcode for this string.
sal_Int32 indexOf (sal_Unicode 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_Unicode 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_Unicode 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 OUString &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 indexOfAsciiL (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 ASCII substring, starting at the specified index.
sal_Int32 lastIndexOf (const OUString &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 OUString &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.
template<typename T >
internal::ConstCharArrayDetector
< T, sal_Int32 >::Type 
lastIndexOf (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_Int32 lastIndexOfAsciiL (char const *str, sal_Int32 len) const throw ()
 Returns the index within this string of the last occurrence of the specified ASCII substring.
OUString copy (sal_Int32 beginIndex) const throw ()
 Returns a new string that is a substring of this string.
OUString copy (sal_Int32 beginIndex, sal_Int32 count) const throw ()
 Returns a new string that is a substring of this string.
OUString concat (const OUString &str) const throw ()
 Concatenates the specified string to the end of this string.
OUString replaceAt (sal_Int32 index, sal_Int32 count, const OUString &newStr) const throw ()
 Returns a new string resulting from replacing n = count characters from position index in this string with newStr.
OUString replace (sal_Unicode oldChar, sal_Unicode newChar) const throw ()
 Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
OUString replaceFirst (OUString const &from, OUString const &to, sal_Int32 *index=0) const
 Returns a new string resulting from replacing the first occurrence of a given substring with another substring.
template<typename T >
internal::ConstCharArrayDetector
< T, OUString >::Type 
replaceFirst (T &from, OUString const &to, sal_Int32 *index=0) const
 Returns a new string resulting from replacing the first occurrence of a given substring with another substring.
template<typename T1 , typename T2 >
internal::ConstCharArrayDetector
< T1, typename
internal::ConstCharArrayDetector
< T2, OUString >::Type >::Type 
replaceFirst (T1 &from, T2 &to, sal_Int32 *index=0) const
 Returns a new string resulting from replacing the first occurrence of a given substring with another substring.
OUString replaceAll (OUString const &from, OUString const &to) const
 Returns a new string resulting from replacing all occurrences of a given substring with another substring.
template<typename T >
internal::ConstCharArrayDetector
< T, OUString >::Type 
replaceAll (T &from, OUString const &to) const
 Returns a new string resulting from replacing all occurrences of a given substring with another substring.
template<typename T1 , typename T2 >
internal::ConstCharArrayDetector
< T1, typename
internal::ConstCharArrayDetector
< T2, OUString >::Type >::Type 
replaceAll (T1 &from, T2 &to) const
 Returns a new string resulting from replacing all occurrences of a given substring with another substring.
OUString toAsciiLowerCase () const throw ()
 Converts from this string all ASCII uppercase characters (65-90) to ASCII lowercase characters (97-122).
OUString toAsciiUpperCase () const throw ()
 Converts from this string all ASCII lowercase characters (97-122) to ASCII uppercase characters (65-90).
OUString trim () const throw ()
 Returns a new string resulting from removing white space from both ends of the string.
OUString getToken (sal_Int32 token, sal_Unicode cTok, sal_Int32 &index) const throw ()
 Returns a token in the string.
OUString getToken (sal_Int32 count, sal_Unicode separator) const
 Returns a token from the string.
sal_Bool toBoolean () const throw ()
 Returns the Boolean value from this string.
sal_Unicode 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.
OUString intern () const
 Return a canonical representation for a string.
bool convertToString (OString *pTarget, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) const
 Converts to an OString, signalling failure.
sal_uInt32 iterateCodePoints (sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1) const
 Iterate through this string based on code points instead of UTF-16 code units.

Static Public Member Functions

static OUString const & unacquired (rtl_uString *const *ppHandle)
 Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
static OUString intern (const sal_Char *value, sal_Int32 length, rtl_TextEncoding encoding, sal_uInt32 convertFlags=OSTRING_TO_OUSTRING_CVTFLAGS, sal_uInt32 *pInfo=NULL)
 Return a canonical representation for a converted string.
static OUString valueOf (sal_Bool b) throw ()
 Returns the string representation of the sal_Bool argument.
static OUString valueOf (sal_Unicode c) throw ()
 Returns the string representation of the char argument.
static OUString valueOf (sal_Int32 i, sal_Int16 radix=10) throw ()
 Returns the string representation of the int argument.
static OUString valueOf (sal_Int64 ll, sal_Int16 radix=10) throw ()
 Returns the string representation of the long argument.
static OUString valueOf (float f) throw ()
 Returns the string representation of the float argument.
static OUString valueOf (double d) throw ()
 Returns the string representation of the double argument.
static OUString createFromAscii (const sal_Char *value) throw ()
 Returns a OUString copied without conversion from an ASCII character string.

Friends

sal_Bool operator== (const OUString &rStr1, const OUString &rStr2) throw ()
sal_Bool operator== (const OUString &rStr1, const sal_Unicode *pStr2) throw ()
sal_Bool operator== (const sal_Unicode *pStr1, const OUString &rStr2) throw ()
sal_Bool operator!= (const OUString &rStr1, const OUString &rStr2) throw ()
sal_Bool operator!= (const OUString &rStr1, const sal_Unicode *pStr2) throw ()
sal_Bool operator!= (const sal_Unicode *pStr1, const OUString &rStr2) throw ()
sal_Bool operator< (const OUString &rStr1, const OUString &rStr2) throw ()
sal_Bool operator> (const OUString &rStr1, const OUString &rStr2) throw ()
sal_Bool operator<= (const OUString &rStr1, const OUString &rStr2) throw ()
sal_Bool operator>= (const OUString &rStr1, const OUString &rStr2) throw ()
template<typename T >
internal::ConstCharArrayDetector
< T, bool >::Type 
operator== (const OUString &string, T &literal)
 Compare string to an ASCII string literal.
template<typename T >
internal::ConstCharArrayDetector
< T, bool >::Type 
operator== (T &literal, const OUString &string)
 Compare string to an ASCII string literal.
template<typename T >
internal::ConstCharArrayDetector
< T, bool >::Type 
operator!= (const OUString &string, T &literal)
 Compare string to an ASCII string literal.
template<typename T >
internal::ConstCharArrayDetector
< T, bool >::Type 
operator!= (T &literal, const OUString &string)
 Compare string to an ASCII string literal.
OUString operator+ (const OUString &rStr1, const OUString &rStr2) throw ()

Detailed Description

This String class provide base functionality for C++ like Unicode character array handling.

The advantage of this class is, that it handle all the memory management 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.


Constructor & Destructor Documentation

rtl::OUString::OUString ( ) throw () [inline]

New string containing no characters.

rtl::OUString::OUString ( const OUString str) throw () [inline]

New string from OUString.

Parameters:
stra OUString.
rtl::OUString::OUString ( rtl_uString *  str) throw () [inline]

New string from OUString data.

Parameters:
stra OUString data.
rtl::OUString::OUString ( rtl_uString *  str,
__sal_NoAcquire   
) throw () [inline]

New OUString from OUString data without acquiring it.

Takeover of ownership.

The SAL_NO_ACQUIRE dummy parameter is only there to distinguish this from other constructors.

Parameters:
strOUString data
rtl::OUString::OUString ( sal_Unicode  value) throw () [inline, explicit]

New string from a single Unicode character.

Parameters:
valuea Unicode character.
rtl::OUString::OUString ( const sal_Unicode value) throw () [inline]

New string from a Unicode character buffer array.

Parameters:
valuea NULL-terminated Unicode character array.
rtl::OUString::OUString ( const sal_Unicode value,
sal_Int32  length 
) throw () [inline]

New string from a Uniocde character buffer array.

Parameters:
valuea Unicode character array.
lengththe number of character which should be copied. The character array length must be greater or equal than this value.
template<typename T >
rtl::OUString::OUString ( T &  literal,
typename internal::ConstCharArrayDetector< T, internal::Dummy >::Type  = internal::Dummy() 
) [inline]

New string from an 8-Bit string literal that is expected to contain only characters in the ASCII set (i.e.

first 128 characters). This constructor allows an efficient and convenient way to create OUString instances from ASCII literals. When creating strings from data that is not pure ASCII, it needs to be converted to OUString by explicitly providing the encoding to use for the conversion.

If there are any embedded \0's in the string literal, the result is undefined. Use the overload that explicitly accepts length.

Parameters:
literalthe 8-bit ASCII string literal
Since:
LibreOffice 3.6
rtl::OUString::OUString ( const sal_Char value,
sal_Int32  length,
rtl_TextEncoding  encoding,
sal_uInt32  convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS 
) [inline]

New string from a 8-Bit character buffer array.

Parameters:
valuea 8-Bit character array.
lengththe number of character which should be converted. The 8-Bit character array length must be greater or equal than this value.
encodingthe text encoding from which the 8-Bit character sequence should be converted.
convertFlagsflags which controls the conversion. see RTL_TEXTTOUNICODE_FLAGS_...
Exceptions:
std::bad_allocis thrown if an out-of-memory condition occurs
rtl::OUString::OUString ( sal_uInt32 const *  codePoints,
sal_Int32  codePointCount 
) [inline, explicit]

Create a new string from an array of Unicode code points.

Parameters:
codePointsan array of at least codePointCount code points, which each must be in the range from 0 to 0x10FFFF, inclusive. May be null if codePointCount is zero.
codePointCountthe non-negative number of code points.
Exceptions:
std::bad_allocis thrown if either an out-of-memory condition occurs or the resulting number of UTF-16 code units would have been larger than SAL_MAX_INT32.
Since:
UDK 3.2.7
rtl::OUString::~OUString ( ) throw () [inline]

Release the string data.


Member Function Documentation

sal_Int32 rtl::OUString::compareTo ( const OUString 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.

Parameters:
strthe object to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
sal_Int32 rtl::OUString::compareTo ( const OUString str,
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.

Parameters:
strthe object to be compared.
maxLengththe maximum count of characters to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
Since:
UDK 3.2.7
sal_Int32 rtl::OUString::compareToAscii ( const sal_Char asciiStr) 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. 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 sorting.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
sal_Int32 rtl::OUString::compareToAscii ( const sal_Char asciiStr,
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. 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 sorting.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
maxLengththe maximum count of characters to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
sal_Int32 rtl::OUString::compareToIgnoreAsciiCaseAscii ( const sal_Char asciiStr) const throw () [inline]

Compares two ASCII strings ignoring case.

The comparison is based on the numeric value of each character in the strings and return a value indicating their relationship. 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 sorting.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
Since:
LibreOffice 3.5
OUString rtl::OUString::concat ( const OUString str) const throw () [inline]

Concatenates the specified string to the end of this string.

Parameters:
strthe string that is concatenated to the end of this string.
Returns:
a string that represents the concatenation of this string followed by the string argument.
bool rtl::OUString::convertToString ( OString pTarget,
rtl_TextEncoding  nEncoding,
sal_uInt32  nFlags 
) const [inline]

Converts to an OString, signalling failure.

Parameters:
pTargetAn out parameter receiving the converted OString. Must not be null; the contents are not modified if conversion fails (convertToOString returns false).
nEncodingThe text encoding to convert into. Must be an octet encoding (i.e., rtl_isOctetTextEncoding(nEncoding) must return true).
nFlagsA combination of RTL_UNICODETOTEXT_FLAGS that detail how to do the conversion (see rtl_convertUnicodeToText). RTL_UNICODETOTEXT_FLAGS_FLUSH need not be included, it is implicitly assumed. Typical uses are either RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR (fail if a Unicode character cannot be converted to the target nEncoding) or OUSTRING_TO_OSTRING_CVTFLAGS (make a best efforts conversion).
Returns:
True if the conversion succeeded, false otherwise.
OUString rtl::OUString::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.

Parameters:
beginIndexthe beginning index, inclusive.
Returns:
the specified substring.
OUString rtl::OUString::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.

Parameters:
beginIndexthe beginning index, inclusive.
countthe number of characters.
Returns:
the specified substring.
static OUString rtl::OUString::createFromAscii ( const sal_Char value) throw () [inline, static]

Returns a OUString copied without conversion from an ASCII character string.

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.

Note that for string literals it is simpler and more efficient to directly use the OUString constructor.

Parameters:
valuethe 8-Bit ASCII character string
Returns:
a string with the string representation of the argument.
bool rtl::OUString::endsWith ( OUString const &  str) const [inline]

Check whether this string ends with a given substring.

Parameters:
strthe substring to be compared
Returns:
true if and only if the given str appears as a substring at the end of this string
Since:
LibreOffice 3.6
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type rtl::OUString::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.

Since:
LibreOffice 3.6
bool rtl::OUString::endsWithAsciiL ( char const *  asciiStr,
sal_Int32  asciiStrLength 
) const [inline]

Check whether this string ends with a given ASCII string.

Parameters:
asciiStra sequence of at least asciiStrLength ASCII characters (bytes in the range 0x00--0x7F)
asciiStrLengththe length of asciiStr; must be non-negative
Returns:
true if this string ends with asciiStr; otherwise, false is returned
Since:
UDK 3.2.7
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type rtl::OUString::endsWithIgnoreAsciiCase ( 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.

Since:
LibreOffice 3.6
sal_Bool rtl::OUString::endsWithIgnoreAsciiCase ( const OUString str) const throw () [inline]

Check whether this string ends with a given string, ignoring the case of ASCII letters.

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.

Parameters:
strthe object (substring) to be compared.
Returns:
true if this string ends with str, ignoring the case of ASCII letters ("A"--"Z" and "a"--"z"); otherwise, false is returned
Since:
LibreOffice 3.6
bool rtl::OUString::endsWithIgnoreAsciiCaseAsciiL ( char const *  asciiStr,
sal_Int32  asciiStrLength 
) const [inline]

Check whether this string ends with a given ASCII string, ignoring the case of ASCII letters.

Parameters:
asciiStra sequence of at least asciiStrLength ASCII characters (bytes in the range 0x00--0x7F)
asciiStrLengththe length of asciiStr; must be non-negative
Returns:
true if this string ends with asciiStr, ignoring the case of ASCII letters ("A"--"Z" and "a"--"z"); otherwise, false is returned
sal_Bool rtl::OUString::equals ( const OUString str) const throw () [inline]

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.

Parameters:
strthe object to be compared.
Returns:
sal_True if the strings are equal; sal_False, otherwise.
sal_Bool rtl::OUString::equalsAscii ( const sal_Char asciiStr) const throw () [inline]

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. 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.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
Returns:
sal_True if the strings are equal; sal_False, otherwise.
sal_Bool rtl::OUString::equalsAsciiL ( const sal_Char asciiStr,
sal_Int32  asciiStrLength 
) const throw () [inline]

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. 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 and must be greater or equal as asciiStrLength. This function can't be used for language specific comparison.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
asciiStrLengththe length of the ascii string
Returns:
sal_True if the strings are equal; sal_False, otherwise.
sal_Bool rtl::OUString::equalsIgnoreAsciiCase ( const OUString str) 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). This function can't be used for language specific comparison.

Parameters:
strthe object to be compared.
Returns:
sal_True if the strings are equal; sal_False, otherwise.
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type rtl::OUString::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.

Since:
LibreOffice 3.6
sal_Bool rtl::OUString::equalsIgnoreAsciiCaseAscii ( const sal_Char 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.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
Returns:
sal_True if the strings are equal; sal_False, otherwise.
sal_Bool rtl::OUString::equalsIgnoreAsciiCaseAsciiL ( 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 NULL-terminated and must be greater or equal as asciiStrLength. This function can't be used for language specific comparison.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
asciiStrLengththe length of the ascii string
Returns:
sal_True if the strings are equal; sal_False, otherwise.
sal_Int32 rtl::OUString::getLength ( ) const throw () [inline]

Returns the length of this string.

The length is equal to the number of Unicode characters in this string.

Returns:
the length of the sequence of characters represented by this object.
const sal_Unicode* rtl::OUString::getStr ( ) const throw () [inline]

Returns a pointer to the Unicode character buffer from this string.

It isn't necessarily NULL terminated.

Returns:
a pointer to the Unicode characters buffer from this object.
OUString rtl::OUString::getToken ( sal_Int32  token,
sal_Unicode  cTok,
sal_Int32 &  index 
) const throw () [inline]

Returns a token in the string.

Example: sal_Int32 nIndex = 0; do { ... OUString aToken = aStr.getToken( 0, ';', nIndex ); ... } while ( nIndex >= 0 );

Parameters:
tokenthe number of the token to return
cTokthe character which seperate the tokens.
indexthe position at which the token is searched in the string. The index must not be greater than the length of the string. This param is set to the position of the next token or to -1, if it is the last token.
Returns:
the token; if either token or index is negative, an empty token is returned (and index is set to -1)
OUString rtl::OUString::getToken ( sal_Int32  count,
sal_Unicode  separator 
) const [inline]

Returns a token from the string.

The same as getToken(sal_Int32, sal_Unicode, sal_Int32 &), but always passing in 0 as the start index in the third argument.

Parameters:
countthe number of the token to return, starting with 0
separatorthe character which separates the tokens
Returns:
the given token, or an empty string
Since:
LibreOffice 3.6
sal_Int32 rtl::OUString::hashCode ( ) const throw () [inline]

Returns a hashcode for this string.

Returns:
a hash code value for this object.
See also:
rtl::OUStringHash for convenient use of boost::unordered_map
sal_Int32 rtl::OUString::indexOf ( sal_Unicode  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.

Parameters:
chcharacter to be located.
fromIndexthe index to start the search from. The index must be greater or equal than 0 and less or equal as the string length.
Returns:
the index of the first occurrence of the character in the character sequence represented by this string that is greater than or equal to fromIndex, or -1 if the character does not occur.
sal_Int32 rtl::OUString::indexOf ( const OUString 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.

Parameters:
strthe substring to search for.
fromIndexthe index to start the search from.
Returns:
If the string argument occurs one or more times as a substring within this string at the starting index, then the index of the first character of the first such substring is returned. If it does not occur as a substring starting at fromIndex or beyond, -1 is returned.
template<typename T >
internal::ConstCharArrayDetector< T, sal_Int32 >::Type rtl::OUString::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.

Since:
LibreOffice 3.6
sal_Int32 rtl::OUString::indexOfAsciiL ( 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 ASCII substring, starting at the specified index.

Parameters:
strthe substring to be searched for. Need not be null-terminated, but must be at least as long as the specified len. Must only contain characters in the ASCII range 0x00--7F.
lenthe length of the substring; must be non-negative.
fromIndexthe index to start the search from. Must be in the range from zero to the length of this string, inclusive.
Returns:
the index (starting at 0) of the first character of the first occurrence of the substring within this string starting at the given fromIndex, or -1 if the substring does not occur. If len is zero, -1 is returned.
Since:
UDK 3.2.7
OUString rtl::OUString::intern ( ) const [inline]

Return a canonical representation for a string.

A pool of strings, initially empty is maintained privately by the string class. On invocation, if present in the pool the original string will be returned. Otherwise this string, or a copy thereof will be added to the pool and returned.

Returns:
a version of the string from the pool.
Exceptions:
std::bad_allocis thrown if an out-of-memory condition occurs
Since:
UDK 3.2.7
static OUString rtl::OUString::intern ( const sal_Char value,
sal_Int32  length,
rtl_TextEncoding  encoding,
sal_uInt32  convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS,
sal_uInt32 *  pInfo = NULL 
) [inline, static]

Return a canonical representation for a converted string.

A pool of strings, initially empty is maintained privately by the string class. On invocation, if present in the pool the original string will be returned. Otherwise this string, or a copy thereof will be added to the pool and returned.

Parameters:
valuea 8-Bit character array.
lengththe number of character which should be converted. The 8-Bit character array length must be greater or equal than this value.
encodingthe text encoding from which the 8-Bit character sequence should be converted.
convertFlagsflags which controls the conversion. see RTL_TEXTTOUNICODE_FLAGS_...
pInfopointer to return conversion status or NULL.
Returns:
a version of the converted string from the pool.
Exceptions:
std::bad_allocis thrown if an out-of-memory condition occurs
Since:
UDK 3.2.7
bool rtl::OUString::isEmpty ( ) const throw () [inline]

Checks if a string is empty.

Returns:
sal_True if the string is empty; sal_False, otherwise.
Since:
LibreOffice 3.4
sal_uInt32 rtl::OUString::iterateCodePoints ( sal_Int32 *  indexUtf16,
sal_Int32  incrementCodePoints = 1 
) const [inline]

Iterate through this string based on code points instead of UTF-16 code units.

See Chapter 3 of The Unicode Standard 5.0 (Addison--Wesley, 2006) for definitions of the various terms used in this description.

This string is interpreted as a sequence of zero or more UTF-16 code units. For each index into this sequence (from zero to one less than the length of the sequence, inclusive), a code point represented starting at the given index is computed as follows:

  • If the UTF-16 code unit addressed by the index constitutes a well-formed UTF-16 code unit sequence, the computed code point is the scalar value encoded by that UTF-16 code unit sequence.
  • Otherwise, if the index is at least two UTF-16 code units away from the end of the sequence, and the sequence of two UTF-16 code units addressed by the index constitutes a well-formed UTF-16 code unit sequence, the computed code point is the scalar value encoded by that UTF-16 code unit sequence.
  • Otherwise, the computed code point is the UTF-16 code unit addressed by the index. (This last case catches unmatched surrogates as well as indices pointing into the middle of surrogate pairs.)
Parameters:
indexUtf16pointer to a UTF-16 based index into this string; must not be null. On entry, the index must be in the range from zero to the length of this string (in UTF-16 code units), inclusive. Upon successful return, the index will be updated to address the UTF-16 code unit that is the given incrementCodePoints away from the initial index.
incrementCodePointsthe number of code points to move the given *indexUtf16. If non-negative, moving is done after determining the code point at the index. If negative, moving is done before determining the code point at the (then updated) index. The value must be such that the resulting UTF-16 based index is in the range from zero to the length of this string (in UTF-16 code units), inclusive.
Returns:
the code point (an integer in the range from 0 to 0x10FFFF, inclusive) that is represented within this string starting at the index computed as follows: If incrementCodePoints is non-negative, the index is the initial value of *indexUtf16; if incrementCodePoints is negative, the index is the updated value of *indexUtf16. In either case, the computed index must be in the range from zero to one less than the length of this string (in UTF-16 code units), inclusive.
Since:
UDK 3.2.7
sal_Int32 rtl::OUString::lastIndexOf ( sal_Unicode  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.

Parameters:
chcharacter to be located.
fromIndexthe index before which to start the search.
Returns:
the index of the last occurrence of the character in the character sequence represented by this string that is less than fromIndex, or -1 if the character does not occur before that point.
sal_Int32 rtl::OUString::lastIndexOf ( sal_Unicode  ch) const throw () [inline]

Returns the index within this string of the last occurrence of the specified character, searching backward starting at the end.

Parameters:
chcharacter to be located.
Returns:
the index of the last occurrence of the character in the character sequence represented by this string, or -1 if the character does not occur.
sal_Int32 rtl::OUString::lastIndexOf ( const OUString 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.

Parameters:
strthe substring to search for.
Returns:
If the string argument occurs one or more times as a substring within this string, then the index of the first character of the last such substring is returned. If it does not occur as a substring, -1 is returned.
sal_Int32 rtl::OUString::lastIndexOf ( const OUString 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.

Parameters:
strthe substring to search for.
fromIndexthe index before which to start the search.
Returns:
If the string argument occurs one or more times as a substring within this string before the starting index, then the index of the first character of the last such substring is returned. Otherwise, -1 is returned.
template<typename T >
internal::ConstCharArrayDetector< T, sal_Int32 >::Type rtl::OUString::lastIndexOf ( 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.

Since:
LibreOffice 3.6
sal_Int32 rtl::OUString::lastIndexOfAsciiL ( char const *  str,
sal_Int32  len 
) const throw () [inline]

Returns the index within this string of the last occurrence of the specified ASCII substring.

Parameters:
strthe substring to be searched for. Need not be null-terminated, but must be at least as long as the specified len. Must only contain characters in the ASCII range 0x00--7F.
lenthe length of the substring; must be non-negative.
Returns:
the index (starting at 0) of the first character of the last occurrence of the substring within this string, or -1 if the substring does not occur. If len is zero, -1 is returned.
Since:
UDK 3.2.7
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type rtl::OUString::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.

Since:
LibreOffice 3.6
sal_Bool rtl::OUString::match ( const OUString 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.

Parameters:
strthe object (substring) to be compared.
fromIndexthe index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length.
Returns:
sal_True if str match with the characters in the string at the given position; sal_False, otherwise.
sal_Bool rtl::OUString::matchAsciiL ( const sal_Char asciiStr,
sal_Int32  asciiStrLength,
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. 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 and must be greater or equal as asciiStrLength. This function can't be used for language specific comparison.

Parameters:
asciiStrthe object (substring) to be compared.
asciiStrLengththe length of asciiStr.
fromIndexthe index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length.
Returns:
sal_True if str match with the characters in the string at the given position; sal_False, otherwise.
sal_Bool rtl::OUString::matchIgnoreAsciiCase ( const OUString 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.

Parameters:
strthe object (substring) to be compared.
fromIndexthe index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length.
Returns:
sal_True if str match with the characters in the string at the given position; sal_False, otherwise.
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type rtl::OUString::matchIgnoreAsciiCase ( 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.

Since:
LibreOffice 3.6
sal_Bool rtl::OUString::matchIgnoreAsciiCaseAsciiL ( const sal_Char asciiStr,
sal_Int32  asciiStrLength,
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). 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 and must be greater or equal as asciiStrLength. This function can't be used for language specific comparison.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
asciiStrLengththe length of the ascii string
fromIndexthe index to start the comparion from. The index must be greater or equal than 0 and less or equal as the string length.
Returns:
sal_True if str match with the characters in the string at the given position; sal_False, otherwise.
OUString& rtl::OUString::operator+= ( const OUString str) throw () [inline]

Append a string to this string.

Parameters:
stra OUString.
OUString& rtl::OUString::operator= ( const OUString str) throw () [inline]

Assign a new string.

Parameters:
stra OUString.
template<typename T >
internal::ConstCharArrayDetector< T, OUString& >::Type rtl::OUString::operator= ( T &  literal) [inline]

Assign a new string from an 8-Bit string literal that is expected to contain only characters in the ASCII set (i.e.

first 128 characters). This operator allows an efficient and convenient way to assign OUString instances from ASCII literals. When assigning strings from data that is not pure ASCII, it needs to be converted to OUString by explicitly providing the encoding to use for the conversion.

Parameters:
literalthe 8-bit ASCII string literal
Since:
LibreOffice 3.6
sal_Unicode rtl::OUString::operator[] ( sal_Int32  index) const [inline]

Access to individual characters.

Parameters:
indexmust be non-negative and less than length.
Returns:
the character at the given index.
Since:
LibreOffice 3.5
OUString rtl::OUString::replace ( sal_Unicode  oldChar,
sal_Unicode  newChar 
) const throw () [inline]

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.

Parameters:
oldCharthe old character.
newCharthe new character.
Returns:
a string derived from this string by replacing every occurrence of oldChar with newChar.
template<typename T1 , typename T2 >
internal::ConstCharArrayDetector< T1, typename internal::ConstCharArrayDetector< T2, OUString >::Type >::Type rtl::OUString::replaceAll ( T1 &  from,
T2 &  to 
) const [inline]

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".

Parameters:
fromASCII string literal, the substring to be replaced
toASCII string literal, the substring to be replaced
Since:
LibreOffice 3.6
OUString rtl::OUString::replaceAll ( OUString const &  from,
OUString const &  to 
) const [inline]

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".

Parameters:
fromthe substring to be replaced
tothe replacing substring
Since:
LibreOffice 3.6
template<typename T >
internal::ConstCharArrayDetector< T, OUString >::Type rtl::OUString::replaceAll ( T &  from,
OUString const &  to 
) const [inline]

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".

Parameters:
fromASCII string literal, the substring to be replaced
tothe replacing substring
Since:
LibreOffice 3.6
OUString rtl::OUString::replaceAt ( sal_Int32  index,
sal_Int32  count,
const OUString newStr 
) const throw () [inline]

Returns a new string resulting from replacing n = count characters from position index in this string with newStr.

Parameters:
indexthe replacing index in str. The index must be greater or equal as 0 and less or equal as the length of the string.
countthe 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.
newStrthe new substring.
Returns:
the new string.
OUString rtl::OUString::replaceFirst ( OUString const &  from,
OUString 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.

Parameters:
fromthe substring to be replaced
tothe replacing substring
[in,out]indexpointer 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
Since:
LibreOffice 3.6
template<typename T >
internal::ConstCharArrayDetector< T, OUString >::Type rtl::OUString::replaceFirst ( T &  from,
OUString 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.

Parameters:
fromASCII string literal, the substring to be replaced
tothe replacing substring
[in,out]indexpointer 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
Since:
LibreOffice 3.6
template<typename T1 , typename T2 >
internal::ConstCharArrayDetector< T1, typename internal::ConstCharArrayDetector< T2, OUString >::Type >::Type rtl::OUString::replaceFirst ( T1 &  from,
T2 &  to,
sal_Int32 *  index = 0 
) const [inline]

Returns a new string resulting from replacing the first occurrence of a given substring with another substring.

Parameters:
fromASCII string literal, the substring to be replaced
toASCII string literal, the substring to be replaced
[in,out]indexpointer 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
Since:
LibreOffice 3.6
sal_Int32 rtl::OUString::reverseCompareTo ( const OUString 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.

Parameters:
strthe object to be compared.
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
sal_Int32 rtl::OUString::reverseCompareToAsciiL ( const sal_Char asciiStr,
sal_Int32  asciiStrLength 
) const throw () [inline]

Compares two strings in reverse order.

This could be useful, if normally both strings start with the same content. The comparison is based on the numeric value of each character in the strings and return a value indicating their relationship. 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 and must be greater or equal as asciiStrLength. This function can't be used for language specific sorting.

Parameters:
asciiStrthe 8-Bit ASCII character string to be compared.
asciiStrLengththe length of the ascii string
Returns:
0 - if both strings are equal < 0 - if this string is less than the string argument > 0 - if this string is greater than the string argument
OUString rtl::OUString::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.

Returns:
the string, converted to ASCII lowercase.
OUString rtl::OUString::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.

Returns:
the string, converted to ASCII uppercase.
sal_Bool rtl::OUString::toBoolean ( ) const throw () [inline]

Returns the Boolean value from this string.

This function can't be used for language specific conversion.

Returns:
sal_True, if the string is 1 or "True" in any ASCII case. sal_False in any other case.
sal_Unicode rtl::OUString::toChar ( ) const throw () [inline]

Returns the first character from this string.

Returns:
the first character from this string or 0, if this string is emptry.
double rtl::OUString::toDouble ( ) const throw () [inline]

Returns the double value from this string.

This function can't be used for language specific conversion.

Returns:
the double represented from this string. 0.0 if this string represents no number.
float rtl::OUString::toFloat ( ) const throw () [inline]

Returns the float value from this string.

This function can't be used for language specific conversion.

Returns:
the float represented from this string. 0.0 if this string represents no number.
sal_Int32 rtl::OUString::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.

Parameters:
radixthe radix (between 2 and 36)
Returns:
the int32 represented from this string. 0 if this string represents no number.
sal_Int64 rtl::OUString::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.

Parameters:
radixthe radix (between 2 and 36)
Returns:
the int64 represented from this string. 0 if this string represents no number.
OUString rtl::OUString::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, with white space removed from the front and end.
static OUString const& rtl::OUString::unacquired ( rtl_uString *const *  ppHandle) [inline, static]

Provides an OUString const & passing a storage pointer of an rtl_uString * handle.

It is more convenient to use C++ OUString member functions when dealing with rtl_uString * handles. Using this function avoids unnecessary acquire()/release() calls for a temporary OUString object.

Parameters:
ppHandlepointer to storage
Returns:
OUString const & based on given storage
static OUString rtl::OUString::valueOf ( float  f) throw () [inline, static]

Returns the string representation of the float argument.

This function can't be used for language specific conversion.

Parameters:
fa float.
Returns:
a string with the string representation of the argument.
static OUString rtl::OUString::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.

Parameters:
lla int64.
radixthe radix (between 2 and 36)
Returns:
a string with the string representation of the argument.
static OUString rtl::OUString::valueOf ( double  d) throw () [inline, static]

Returns the string representation of the double argument.

This function can't be used for language specific conversion.

Parameters:
da double.
Returns:
a string with the string representation of the argument.
static OUString rtl::OUString::valueOf ( sal_Bool  b) throw () [inline, static]

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.

Parameters:
ba sal_Bool.
Returns:
a string with the string representation of the argument.
static OUString rtl::OUString::valueOf ( sal_Unicode  c) throw () [inline, static]

Returns the string representation of the char argument.

Parameters:
ca character.
Returns:
a string with the string representation of the argument.
static OUString rtl::OUString::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.

Parameters:
ia int32.
radixthe radix (between 2 and 36)
Returns:
a string with the string representation of the argument.

Friends And Related Function Documentation

sal_Bool operator!= ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
sal_Bool operator!= ( const OUString rStr1,
const sal_Unicode pStr2 
) throw () [friend]
sal_Bool operator!= ( const sal_Unicode pStr1,
const OUString rStr2 
) throw () [friend]
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type operator!= ( const OUString string,
T &  literal 
) [friend]

Compare string to an ASCII string literal.

This operator is equal to calling !equalsAsciiL().

Since:
LibreOffice 3.6
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type operator!= ( T &  literal,
const OUString string 
) [friend]

Compare string to an ASCII string literal.

This operator is equal to calling !equalsAsciiL().

Since:
LibreOffice 3.6
OUString operator+ ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
sal_Bool operator< ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
sal_Bool operator<= ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
sal_Bool operator== ( const OUString rStr1,
const sal_Unicode pStr2 
) throw () [friend]
sal_Bool operator== ( const sal_Unicode pStr1,
const OUString rStr2 
) throw () [friend]
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type operator== ( const OUString string,
T &  literal 
) [friend]

Compare string to an ASCII string literal.

This operator is equal to calling equalsAsciiL().

Since:
LibreOffice 3.6
sal_Bool operator== ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
template<typename T >
internal::ConstCharArrayDetector< T, bool >::Type operator== ( T &  literal,
const OUString string 
) [friend]

Compare string to an ASCII string literal.

This operator is equal to calling equalsAsciiL().

Since:
LibreOffice 3.6
sal_Bool operator> ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]
sal_Bool operator>= ( const OUString rStr1,
const OUString rStr2 
) throw () [friend]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines