Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
 Overview   Namespace   Class   Index   Help 

Global Functions in Global Namespace C++
in Sourcefile ustring.h


rtl_string2UString
extern "C"
void rtl_string2UString(
rtl_uString * * newStr,
const sal_Char * str,
sal_Int32 len,
rtl_TextEncoding encoding,
sal_uInt32 convertFlags );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new Unicode string by converting a byte string, using a specific text encoding.
Description
The lengths of the byte string and the Unicode string may differ (e.g., for double-byte encodings, UTF-7, UTF-8). If the length of the byte string is greater than zero, the reference count of the new string will be 1. This function does not handle out-of-memory conditions.
Parameters
newStr
pointer to the new string.  The pointed-to data must be null or a valid
string.

str
a byte character array.  Need not be null-terminated, but must be at
least as long as the specified len.

len
the length of the byte character array.

encoding
the text encoding to use for conversion.

convertFlags
flags which control the conversion.  Either use
OSTRING_TO_OUSTRING_CVTFLAGS, or see
 for more
details.

rtl_uString_acquire
extern "C"
void rtl_uString_acquire(
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Increment the reference count of a string.
Parameters
str
    a string.
 

rtl_uString_assign
extern "C"
void rtl_uString_assign(
rtl_uString * * str,
rtl_uString * rightValue );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Assign a new value to a string.
Description
First releases any value str might currently hold, then acquires rightValue.
Parameters
str
    pointer to the string.  The pointed-to data must be null or a valid
    string.

    
rightValue
    a valid string.
 

rtl_uString_getLength
extern "C"
sal_Int32 rtl_uString_getLength(
const rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Return the length of a string.
Description
The length is equal to the number of characters in the string.
Parameters
str
    a valid string.

    
Return
the length of the string.

rtl_uString_getStr
extern "C"
sal_Unicode * rtl_uString_getStr(
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Return a pointer to the underlying character array of a string.
Parameters
str
    a valid string.

    
Return
a pointer to the null-terminated character array.

rtl_uString_getToken
extern "C"
sal_Int32 rtl_uString_getToken(
rtl_uString * * newStr,
rtl_uString * str,
sal_Int32 token,
sal_Unicode cTok,
sal_Int32 index );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by extracting a single token from another string.
Description
Starting at index, the token's next token is searched for. If there is no such token, the result is an empty string. Otherwise, all characters from the start of that token and up to, but not including the next occurrence of cTok make up the resulting token. The return value is the position of the next token, or -1 if no more tokens follow. Example code could look like rtl_uString * pToken = NULL; sal_Int32 nIndex = 0; do { ... nIndex = rtl_uString_getToken(&pToken, pStr, 0, ';', nIndex); ... } while (nIndex >= 0); The new string does not necessarily have a reference count of 1, so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
str
    a valid string.

    
token
    the number of the token to return, starting at index.  Must be
    non-negative.

    
cTok
    the character that seperates the tokens.

    
index
    the position at which searching for the token starts.  Must be between 0
    and the length of str, inclusive.

    
Return
the index of the next token, or -1 if no more tokens follow.

rtl_uString_new
extern "C"
void rtl_uString_new(
rtl_uString * * newStr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string containing no characters.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.
 

rtl_uString_newConcat
extern "C"
void rtl_uString_newConcat(
rtl_uString * * newStr,
rtl_uString * left,
rtl_uString * right );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string that is the concatenation of two other strings.
Description
The new string does not necessarily have a reference count of 1 (in cases where one of the two other strings is empty), so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
left
    a valid string.

    
right
    a valid string.
 

rtl_uString_newFromAscii
extern "C"
void rtl_uString_newFromAscii(
rtl_uString * * newStr,
const sal_Char * value );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string that contains a copy of a character array.
Description
If the length of value is greater than zero, the reference count of the new string will be 1. This function does not handle out-of-memory conditions. Since this function 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 of 0 and 127, inclusive.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
value
    a null-terminated ASCII character array.
 

rtl_uString_newFromStr
extern "C"
void rtl_uString_newFromStr(
rtl_uString * * newStr,
const sal_Unicode * value );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string that contains a copy of a character array.
Description
If the length of value is greater than zero, the reference count of the new string will be 1. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
value
    a null-terminated character array.
 

rtl_uString_newFromStr_WithLength
extern "C"
void rtl_uString_newFromStr_WithLength(
rtl_uString * * newStr,
const sal_Unicode * value,
sal_Int32 len );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string that contains a copy of a character array.
Description
If the length of value is greater than zero, the reference count of the new string will be 1. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
value
    a character array.  Need not be null-terminated, but must be at least as
    long as the specified len.

    
len
    the length of the character array.
 

rtl_uString_newFromString
extern "C"
void rtl_uString_newFromString(
rtl_uString * * newStr,
const rtl_uString * value );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string that contains a copy of another string.
Description
If the length of value is greater than zero, the reference count of the new string will be 1. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
value
    a valid string.
 

rtl_uString_newReplace
extern "C"
void rtl_uString_newReplace(
rtl_uString * * newStr,
rtl_uString * str,
sal_Unicode oldChar,
sal_Unicode newChar );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by replacing all occurrences of a single character within another string.
Description
The new string results from replacing all occurrences of oldChar in str with newChar. The new string does not necessarily have a reference count of 1 (in cases where oldChar does not occur in str), so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
pointer to the new string.  The pointed-to data must be null or a valid
string.

str
a valid string.

oldChar
the old character.

newChar
the new character.

rtl_uString_newReplaceStrAt
extern "C"
void rtl_uString_newReplaceStrAt(
rtl_uString * * newStr,
rtl_uString * str,
sal_Int32 index,
sal_Int32 count,
rtl_uString * subStr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by replacing a substring of another string.
Description
The new string results from replacing a number of characters (count), starting at the specified position (index) in the original string (str), with some new substring (subStr). If subStr is null, than only a number of characters is deleted. The new string does not necessarily have a reference count of 1, so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
str
    a valid string.

    
index
    the index into str at which to start replacement.  Must be between 0 and
    the length of str, inclusive.

    
count
    the number of charcters to remove.  Must not be negative, and the sum of
    index and count must not exceed the length of str.

    
subStr
    either null or a valid string to be inserted.
 

rtl_uString_newToAsciiLowerCase
extern "C"
void rtl_uString_newToAsciiLowerCase(
rtl_uString * * newStr,
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by converting all ASCII uppercase letters to lowercase within another string.
Description
The new string results from replacing all characters with values between 65 and 90 (ASCII A--Z) by values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific conversion. The new string does not necessarily have a reference count of 1 (in cases where no characters need to be converted), so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
pointer to the new string.  The pointed-to data must be null or a valid
string.

str
a valid string.

rtl_uString_newToAsciiUpperCase
extern "C"
void rtl_uString_newToAsciiUpperCase(
rtl_uString * * newStr,
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by converting all ASCII lowercase letters to uppercase within another string.
Description
The new string results from replacing all characters with values between 97 and 122 (ASCII a--z) by values between 65 and 90 (ASCII A--Z). This function cannot be used for language-specific conversion. The new string does not necessarily have a reference count of 1 (in cases where no characters need to be converted), so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
pointer to the new string.  The pointed-to data must be null or a valid
string.

str
a valid string.

rtl_uString_newTrim
extern "C"
void rtl_uString_newTrim(
rtl_uString * * newStr,
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create a new string by removing white space from both ends of another string.
Description
The new string results from removing all characters with values less than or equal to 32 (the space character) form both ends of str. This function cannot be used for language-specific conversion. The new string does not necessarily have a reference count of 1 (in cases where no characters need to be removed), so it must not be modified without checking the reference count. This function does not handle out-of-memory conditions.
Parameters
newStr
pointer to the new string.  The pointed-to data must be null or a valid
string.

str
a valid string.

rtl_uString_new_WithLength
extern "C"
void rtl_uString_new_WithLength(
rtl_uString * * newStr,
sal_Int32 nLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Allocate a new string containing space for a given number of characters.
Description
If len is greater than zero, the reference count of the new string will be 1. The values of all characters are set to 0 and the length of the string is 0. This function does not handle out-of-memory conditions.
Parameters
newStr
    pointer to the new string.  The pointed-to data must be null or a valid
    string.

    
len
    the number of characters.
 

rtl_uString_release
extern "C"
void rtl_uString_release(
rtl_uString * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Decrement the reference count of a string.
Description
If the count goes to zero than the string data is deleted.
Parameters
str
    a string.
 

rtl_ustr_ascii_compare
extern "C"
sal_Int32 rtl_ustr_ascii_compare(
const sal_Unicode * first,
const sal_Char * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting. Both strings must be null-terminated. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first null-terminated string to be compared.

    
second
    the second null-terminated ASCII string which is compared with the first
    one.

    
Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_ascii_compareIgnoreAsciiCase
extern "C"
sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase(
const sal_Unicode * first,
const sal_Char * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting. Both strings must be null-terminated. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first null-terminated string to be compared.

    
second
    the second null-terminated ASCII string which is compared with the first
    one.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength
extern "C"
sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Char * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second null-terminated ASCII string which is compared with the first
    one.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_ascii_compare_WithLength
extern "C"
sal_Int32 rtl_ustr_ascii_compare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Char * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second null-terminated ASCII string which is compared with the first
    one.

    
Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength
extern "C"
sal_Int32 rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Char * second,
sal_Int32 shortenedLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting. Since this function 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 of 0 and 127, inclusive.
Parameters
first
the first string to be compared.  Need not be null-terminated, but must be
at least as long as the specified firstLen.

firstLen
the length of the first string.

second
the second null-terminated ASCII string which is compared with the first
one.

shortenedLen
the maximum number of characters to compare.  This length can be greater
or smaller than the lengths of the two strings.

Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_ascii_shortenedCompare_WithLength
extern "C"
sal_Int32 rtl_ustr_ascii_shortenedCompare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Char * second,
sal_Int32 shortenedLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings with a maximum count of characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second null-terminated ASCII string which is compared with the first
    one.

    
shortenedLen
    the maximum number of characters to compare.  This length can be greater
    or smaller than the lengths of the two strings.

    
Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_asciil_reverseCompare_WithLength
extern "C"
sal_Int32 rtl_ustr_asciil_reverseCompare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Char * second,
sal_Int32 secondLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings from back to front.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting. Since this function 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 of 0 and 127, inclusive.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second ASCII string which is compared with the first one.  Need not be
    null-terminated, but must be at least as long as the specified secondLen.

    
secondLen
    the length of the second string.

    
Return
0 if both strings are equal, a value less than 0 if the first string compares less than the second string, and a value greater than 0 if the first string compares greater than the second string.

rtl_ustr_compare
extern "C"
sal_Int32 rtl_ustr_compare(
const sal_Unicode * first,
const sal_Unicode * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting. Both strings must be null-terminated.
Parameters
first
    the first null-terminated string to be compared.

    
second
    the second null-terminated string which is compared with the first one.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_compareIgnoreAsciiCase
extern "C"
sal_Int32 rtl_ustr_compareIgnoreAsciiCase(
const sal_Unicode * first,
const sal_Unicode * second );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting. Both strings must be null-terminated.
Parameters
first
    the first null-terminated string to be compared.

    
second
    the second null-terminated string which is compared with the first one.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_compareIgnoreAsciiCase_WithLength
extern "C"
sal_Int32 rtl_ustr_compareIgnoreAsciiCase_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Unicode * second,
sal_Int32 secondLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second string which is compared with the first one.  Need not be
    null-terminated, but must be at least as long as the specified secondLen.

    
secondLen
    the length of the second string.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_compare_WithLength
extern "C"
sal_Int32 rtl_ustr_compare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Unicode * second,
sal_Int32 secondLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second string which is compared with the first one.  Need not be
    null-terminated, but must be at least as long as the specified secondLen.

    
secondLen
    the length of the second string.

    
Return
0 if both strings are equal, a value less than 0 if the first string is less than the second string, and a value greater than 0 if the first string is greater than the second string.

rtl_ustr_getLength
extern "C"
sal_Int32 rtl_ustr_getLength(
const sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Return the length of a string.
Description
The length is equal to the number of 16-bit Unicode characters in the string, without the terminating NUL character.
Parameters
str
    a null-terminated string.

    
Return
the length of the sequence of characters represented by this string, excluding the terminating NUL character.

rtl_ustr_hashCode
extern "C"
sal_Int32 rtl_ustr_hashCode(
const sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Return a hash code for a string.
Description
It is not allowed to store the hash code persistently, because later versions could return other hash codes. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
Return
a hash code for the given string.

rtl_ustr_hashCode_WithLength
extern "C"
sal_Int32 rtl_ustr_hashCode_WithLength(
const sal_Unicode * str,
sal_Int32 len );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Return a hash code for a string.
Description
It is not allowed to store the hash code persistently, because later versions could return other hash codes.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
Return
a hash code for the given string.

rtl_ustr_indexOfChar
extern "C"
sal_Int32 rtl_ustr_indexOfChar(
const sal_Unicode * str,
sal_Unicode ch );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the first occurrence of a character within a string.
Description
The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
ch
    the character to be searched for.

    
Return
the index (starting at 0) of the first occurrence of the character in the string, or -1 if the character does not occur.

rtl_ustr_indexOfChar_WithLength
extern "C"
sal_Int32 rtl_ustr_indexOfChar_WithLength(
const sal_Unicode * str,
sal_Int32 len,
sal_Unicode ch );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the first occurrence of a character within a string.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
ch
    the character to be searched for.

    
Return
the index (starting at 0) of the first occurrence of the character in the string, or -1 if the character does not occur.

rtl_ustr_indexOfStr
extern "C"
sal_Int32 rtl_ustr_indexOfStr(
const sal_Unicode * str,
const sal_Unicode * subStr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the first occurrence of a substring within a string.
Description
If subStr is empty, or both str and subStr are empty, -1 is returned. Both strings must be null-terminated.
Parameters
str
    a null-terminated string.

    
subStr
    the null-terminated substring to be searched for.

    
Return
the index (starting at 0) of the first character of the first occurrence of the substring within the string, or -1 if the substring does not occur.

rtl_ustr_indexOfStr_WithLength
extern "C"
sal_Int32 rtl_ustr_indexOfStr_WithLength(
const sal_Unicode * str,
sal_Int32 len,
const sal_Unicode * subStr,
sal_Int32 subLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the first occurrence of a substring within a string.
Description
If subStr is empty, or both str and subStr are empty, -1 is returned.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
subStr
    the substring to be searched for.  Need not be null-terminated, but must
    be at least as long as the specified subLen.

    
subLen
    the length of the substring.

    
Return
the index (starting at 0) of the first character of the first occurrence of the substring within the string, or -1 if the substring does not occur.

rtl_ustr_lastIndexOfChar
extern "C"
sal_Int32 rtl_ustr_lastIndexOfChar(
const sal_Unicode * str,
sal_Unicode ch );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the last occurrence of a character within a string.
Description
The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
ch
    the character to be searched for.

    
Return
the index (starting at 0) of the last occurrence of the character in the string, or -1 if the character does not occur. The returned value is always smaller than the string length.

rtl_ustr_lastIndexOfChar_WithLength
extern "C"
sal_Int32 rtl_ustr_lastIndexOfChar_WithLength(
const sal_Unicode * str,
sal_Int32 len,
sal_Unicode ch );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the last occurrence of a character within a string.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
ch
    the character to be searched for.

    
Return
the index (starting at 0) of the last occurrence of the character in the string, or -1 if the character does not occur. The returned value is always smaller than the string length.

rtl_ustr_lastIndexOfStr
extern "C"
sal_Int32 rtl_ustr_lastIndexOfStr(
const sal_Unicode * str,
const sal_Unicode * subStr );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the last occurrence of a substring within a string.
Description
If subStr is empty, or both str and subStr are empty, -1 is returned. Both strings must be null-terminated.
Parameters
str
    a null-terminated string.

    
subStr
    the null-terminated substring to be searched for.

    
Return
the index (starting at 0) of the first character of the last occurrence of the substring within the string, or -1 if the substring does not occur.

rtl_ustr_lastIndexOfStr_WithLength
extern "C"
sal_Int32 rtl_ustr_lastIndexOfStr_WithLength(
const sal_Unicode * str,
sal_Int32 len,
const sal_Unicode * subStr,
sal_Int32 subLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Search for the last occurrence of a substring within a string.
Description
If subStr is empty, or both str and subStr are empty, -1 is returned.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
subStr
    the substring to be searched for.  Need not be null-terminated, but must
    be at least as long as the specified subLen.

    
subLen
    the length of the substring.

    
Return
the index (starting at 0) of the first character of the first occurrence of the substring within the string, or -1 if the substring does not occur.

rtl_ustr_replaceChar
extern "C"
void rtl_ustr_replaceChar(
sal_Unicode * str,
sal_Unicode oldChar,
sal_Unicode newChar );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Replace all occurrences of a single character within a string.
Description
If oldChar does not occur within str, then the string is not modified. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
oldChar
    the old character.

    
newChar
    the new character.
 

rtl_ustr_replaceChar_WithLength
extern "C"
void rtl_ustr_replaceChar_WithLength(
sal_Unicode * str,
sal_Int32 len,
sal_Unicode oldChar,
sal_Unicode newChar );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Replace all occurrences of a single character within a string.
Description
If oldChar does not occur within str, then the string is not modified.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.

    
oldChar
    the old character.

    
newChar
    the new character.
 

rtl_ustr_reverseCompare_WithLength
extern "C"
sal_Int32 rtl_ustr_reverseCompare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Unicode * second,
sal_Int32 secondLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings from back to front.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second string which is compared with the first one.  Need not be
    null-terminated, but must be at least as long as the specified secondLen.

    
secondLen
    the length of the second string.

    
Return
0 if both strings are equal, a value less than 0 if the first string compares less than the second string, and a value greater than 0 if the first string compares greater than the second string.

rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength
extern "C"
sal_Int32 rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Unicode * second,
sal_Int32 secondLen,
sal_Int32 shortenedLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings with a maximum count of characters, ignoring the case of ASCII characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. Character values between 65 and 90 (ASCII A--Z) are interpreted as values between 97 and 122 (ASCII a--z). This function cannot be used for language-specific sorting.
Parameters
first
the first string to be compared.  Need not be null-terminated, but must be
at least as long as the specified firstLen.

firstLen
the length of the first string.

second
the second string which is compared with the first one.  Need not be
null-terminated, but must be at least as long as the specified secondLen.

secondLen
the length of the second string.

shortenedLen
the maximum number of characters to compare.  This length can be greater
or smaller than the lengths of the two strings.

Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_shortenedCompare_WithLength
extern "C"
sal_Int32 rtl_ustr_shortenedCompare_WithLength(
const sal_Unicode * first,
sal_Int32 firstLen,
const sal_Unicode * second,
sal_Int32 secondLen,
sal_Int32 shortenedLen );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Compare two strings with a maximum count of characters.
Description
The comparison is based on the numeric value of each character in the strings and returns a value indicating their relationship. This function cannot be used for language-specific sorting.
Parameters
first
    the first string to be compared.  Need not be null-terminated, but must be
    at least as long as the specified firstLen.

    
firstLen
    the length of the first string.

    
second
    the second string which is compared with the first one.  Need not be
    null-terminated, but must be at least as long as the specified secondLen.

    
secondLen
    the length of the second string.

    
shortenedLen
    the maximum number of characters to compare.  This length can be greater
    or smaller than the lengths of the two strings.

    
Return
0 if both substrings are equal, a value less than 0 if the first substring is less than the second substring, and a value greater than 0 if the first substring is greater than the second substring.

rtl_ustr_toAsciiLowerCase
extern "C"
void rtl_ustr_toAsciiLowerCase(
sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Convert all ASCII uppercase letters to lowercase within a string.
Description
The characters with values between 65 and 90 (ASCII A--Z) are replaced with values between 97 and 122 (ASCII a--z). The string must be null-terminated.
Parameters
str
    a null-terminated string.
 

rtl_ustr_toAsciiLowerCase_WithLength
extern "C"
void rtl_ustr_toAsciiLowerCase_WithLength(
sal_Unicode * str,
sal_Int32 len );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Convert all ASCII uppercase letters to lowercase within a string.
Description
The characters with values between 65 and 90 (ASCII A--Z) are replaced with values between 97 and 122 (ASCII a--z).
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.
 

rtl_ustr_toAsciiUpperCase
extern "C"
void rtl_ustr_toAsciiUpperCase(
sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Convert all ASCII lowercase letters to uppercase within a string.
Description
The characters with values between 97 and 122 (ASCII a--z) are replaced with values between 65 and 90 (ASCII A--Z). The string must be null-terminated.
Parameters
str
    a null-terminated string.
 

rtl_ustr_toAsciiUpperCase_WithLength
extern "C"
void rtl_ustr_toAsciiUpperCase_WithLength(
sal_Unicode * str,
sal_Int32 len );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Convert all ASCII lowercase letters to uppercase within a string.
Description
The characters with values between 97 and 122 (ASCII a--z) are replaced with values between 65 and 90 (ASCII A--Z).
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the length of the string.
 

rtl_ustr_toBoolean
extern "C"
sal_Bool rtl_ustr_toBoolean(
const sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Interpret a string as a boolean.
Description
This function cannot be used for language-specific conversion. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
Return
true if the string is "1" or "true" in any ASCII case, false otherwise.

rtl_ustr_toDouble
extern "C"
double rtl_ustr_toDouble(
const sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Interpret a string as a double.
Description
This function cannot be used for language-specific conversion. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
Return
the float value represented by the string, or 0.0 if the string does not represent a double.

rtl_ustr_toFloat
extern "C"
float rtl_ustr_toFloat(
const sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Interpret a string as a float.
Description
This function cannot be used for language-specific conversion. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
Return
the float value represented by the string, or 0.0 if the string does not represent a float.

rtl_ustr_toInt32
extern "C"
sal_Int32 rtl_ustr_toInt32(
const sal_Unicode * str,
sal_Int16 radix );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Interpret a string as an integer.
Description
This function cannot be used for language-specific conversion. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
radix
    the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
    (36), inclusive.

    
Return
the integer value represented by the string, or 0 if the string does not represent an integer.

rtl_ustr_toInt64
extern "C"
sal_Int64 rtl_ustr_toInt64(
const sal_Unicode * str,
sal_Int16 radix );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Interpret a string as a long integer.
Description
This function cannot be used for language-specific conversion. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
radix
    the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
    (36), inclusive.

    
Return
the long integer value represented by the string, or 0 if the string does not represent a long integer.

rtl_ustr_trim
extern "C"
sal_Int32 rtl_ustr_trim(
sal_Unicode * str );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Remove white space from both ends of a string.
Description
All characters with values less than or equal to 32 (the space character) are considered to be white space. This function cannot be used for language-specific operations. The string must be null-terminated.
Parameters
str
    a null-terminated string.

    
Return
the new length of the string.

rtl_ustr_trim_WithLength
extern "C"
sal_Int32 rtl_ustr_trim_WithLength(
sal_Unicode * str,
sal_Int32 len );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Remove white space from both ends of the string.
Description
All characters with values less than or equal to 32 (the space character) are considered to be white space. This function cannot be used for language-specific operations. The string must be null-terminated.
Parameters
str
    a string.  Need not be null-terminated, but must be at least as long as
    the specified len.

    
len
    the original length of the string.

    
Return
the new length of the string.

rtl_ustr_valueOfBoolean
extern "C"
sal_Int32 rtl_ustr_valueOfBoolean(
sal_Unicode * str,
sal_Bool b );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of a boolean.
Description
If b is true, the buffer is filled with the string "true" and 5 is returned. If b is false, the buffer is filled with the string "false" and 6 is returned. This function cannot be used for language-specific operations.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFBOOLEAN define to
    create a buffer that is big enough.

    
b
    a boolean value.

    
Return
the length of the string.

rtl_ustr_valueOfChar
extern "C"
sal_Int32 rtl_ustr_valueOfChar(
sal_Unicode * str,
sal_Unicode ch );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of a character.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFCHAR define to create a
    buffer that is big enough.

    
ch
    a character value.

    
Return
the length of the string.

rtl_ustr_valueOfDouble
extern "C"
sal_Int32 rtl_ustr_valueOfDouble(
sal_Unicode * str,
double d );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of a double.
Description
This function cannot be used for language-specific conversion.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFDOUBLE define to create
    a buffer that is big enough.

    
d
    a double value.

    
Return
the length of the string.

rtl_ustr_valueOfFloat
extern "C"
sal_Int32 rtl_ustr_valueOfFloat(
sal_Unicode * str,
float f );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of a float.
Description
This function cannot be used for language-specific conversion.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFFLOAT define to create
    a buffer that is big enough.

    
f
    a float value.

    
Return
the length of the string.

rtl_ustr_valueOfInt32
extern "C"
sal_Int32 rtl_ustr_valueOfInt32(
sal_Unicode * str,
sal_Int32 i,
sal_Int16 radix );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of an integer.
Description
This function cannot be used for language-specific operations.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFINT32 define to create
    a buffer that is big enough.

    
i
    an integer value.

    
radix
    the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
    (36), inclusive.

    
Return
the length of the string.

rtl_ustr_valueOfInt64
extern "C"
sal_Int32 rtl_ustr_valueOfInt64(
sal_Unicode * str,
sal_Int64 l,
sal_Int16 radix );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Create the string representation of a long integer.
Description
This function cannot be used for language-specific operations.
Parameters
str
    a buffer that is big enough to hold the result and the terminating NUL
    character.  You should use the RTL_USTR_MAX_VALUEOFINT64 define to create
    a buffer that is big enough.

    
l
    a long integer value.

    
radix
    the radix.  Must be between RTL_USTR_MIN_RADIX (2) and RTL_USTR_MAX_RADIX
    (36), inclusive.

    
Return
the length of the string.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.