version 1.26, 2001/05/07 13:51:05
|
version 1.27, 2001/05/14 00:39:53
|
|
|
String(const char* x, Uint32 n); | String(const char* x, Uint32 n); |
| |
/// String destructor. Used by the representation of the String object | /// String destructor. Used by the representation of the String object |
~String() |
~String(); |
{ |
|
} |
|
| |
/** Assign this string with x. | /** Assign this string with x. |
<pre> | <pre> |
|
|
String t2 = t1; | String t2 = t1; |
</pre> | </pre> |
*/ | */ |
String& operator=(const String& x) { _rep = x._rep; return *this; } |
String& operator=(const String& x) { return assign(x); } |
| |
/// Assign this string with Char16 x. | /// Assign this string with Char16 x. |
String& operator=(const Char16* x) { assign(x); return *this; } | String& operator=(const Char16* x) { assign(x); return *this; } |
|
|
@param x String to assign | @param x String to assign |
@return Returns the String | @return Returns the String |
*/ | */ |
String& assign(const String& x) { _rep = x._rep; return *this; } |
String& assign(const String& x); |
| |
/// Assign this string with x. | /// Assign this string with x. |
String& assign(const Char16* x); | String& assign(const Char16* x); |
|
|
test.clear(); // String test is now NULL (length == 0) | test.clear(); // String test is now NULL (length == 0) |
</pre> | </pre> |
*/ | */ |
void clear() { _rep.clear(); _rep.append('\0'); } |
void clear(); |
|
|
| |
/** reserve - Reserves memory for capacity characters. Notice that this does | /** reserve - Reserves memory for capacity characters. Notice that this does |
not | not |
|
|
capacity argument. | capacity argument. |
@param capacity defines the capacity in characters to reserve. | @param capacity defines the capacity in characters to reserve. |
*/ | */ |
void reserve(Uint32 capacity) { _rep.reserve(capacity + 1); } |
void reserve(Uint32 capacity); |
| |
/** Returns the length of the String object. | /** Returns the length of the String object. |
@return Length of the string in characters. | @return Length of the string in characters. |
|
|
s4.append(Char16(0x0000)) | s4.append(Char16(0x0000)) |
</pre> | </pre> |
*/ | */ |
String& append(const Char16& c) |
String& append(const Char16& c); |
{ |
|
_rep.insert(_rep.size() - 1, c); |
|
return *this; |
|
} |
|
| |
/// Append n characters from str to this String object. | /// Append n characters from str to this String object. |
String& append(const Char16* str, Uint32 n); | String& append(const Char16* str, Uint32 n); |
|
|
*/ | */ |
Uint32 find(Char16 c) const; | Uint32 find(Char16 c) const; |
| |
|
|
/** Find the position of the first occurence of the string object. | /** Find the position of the first occurence of the string object. |
This function finds one string inside another | This function finds one string inside another |
If the matching substring is not found, -1 is returned. | If the matching substring is not found, -1 is returned. |
|
|
*/ | */ |
static int compare(const Char16* s1, const Char16* s2, Uint32 n); | static int compare(const Char16* s1, const Char16* s2, Uint32 n); |
| |
|
/** Just like one above except ignores case differences. |
|
*/ |
|
static int compareNoCase(const char* s1, const char* s2, Uint32 n); |
|
|
/** Compare two null-terminated strings. | /** Compare two null-terminated strings. |
@param s1 First null-terminated string for the comparison | @param s1 First null-terminated string for the comparison |
@param s2 Second null-terminated string for the comparison | @param s2 Second null-terminated string for the comparison |
|
|
/// Return true if the two strings are equal. | /// Return true if the two strings are equal. |
static Boolean equal(const char* x, const String& y); | static Boolean equal(const char* x, const String& y); |
| |
static Boolean equalIgnoreCase(const String& x, const String& y); |
static Boolean equalNoCase(const String& x, const String& y); |
| |
/// Convert the plain old C-string to lower case: | /// Convert the plain old C-string to lower case: |
static void toLower(char* str); | static void toLower(char* str); |
|
|
| |
/** Compare two strings but ignore any case differences. | /** Compare two strings but ignore any case differences. |
*/ | */ |
PEGASUS_COMMON_LINKAGE int CompareIgnoreCase(const char* s1, const char* s2); |
PEGASUS_COMMON_LINKAGE int CompareNoCase(const char* s1, const char* s2); |
| |
/** Get the next line from the input file. | /** Get the next line from the input file. |
*/ | */ |
|
|
return tmp; | return tmp; |
} | } |
| |
|
PEGASUS_COMMON_LINKAGE const Array<String>& EmptyStringArray(); |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* Pegasus_String_h */ | #endif /* Pegasus_String_h */ |