version 1.1, 2001/01/14 19:53:14
|
version 1.2, 2001/02/11 05:42:33
|
|
|
// Author: | // Author: |
// | // |
// $Log$ | // $Log$ |
// Revision 1.1 2001/01/14 19:53:14 mike |
// Revision 1.2 2001/02/11 05:42:33 mike |
// Initial revision |
// new |
|
// |
|
// Revision 1.1.1.1 2001/01/14 19:53:14 mike |
|
// Pegasus import |
// | // |
// | // |
//END_HISTORY | //END_HISTORY |
| |
|
#include <cctype> |
#include "String.h" | #include "String.h" |
#include "Exception.h" | #include "Exception.h" |
#include "String.h" | #include "String.h" |
|
|
| |
const String String::EMPTY; | const String String::EMPTY; |
| |
void ThrowNullPointer() |
inline Uint32 StrLen(const char* str) |
{ | { |
|
if (!str) |
throw NullPointer(); | throw NullPointer(); |
|
|
|
return strlen(str); |
} | } |
| |
Uint32 StrLen(const Char16* str) |
inline Uint32 StrLen(const Char16* str) |
{ | { |
if (!str) | if (!str) |
ThrowNullPointer(); |
throw NullPointer(); |
| |
Uint32 n = 0; | Uint32 n = 0; |
| |
|
|
return operator==(String(x), y); | return operator==(String(x), y); |
} | } |
| |
|
void String::toLower(char* str) |
|
{ |
|
while (*str) |
|
tolower(*str++); |
|
} |
|
|
|
String ToLower(const String& str) |
|
{ |
|
String tmp(str); |
|
|
|
for (Uint32 i = 0, n = tmp.getLength(); i < n; i++) |
|
{ |
|
Char16 c = tmp[i]; |
|
|
|
if (c <= 127) |
|
tmp[i] = tolower(c); |
|
} |
|
|
|
return tmp; |
|
} |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |