version 1.39, 2002/05/06 20:13:08
|
version 1.41, 2002/06/01 00:56:38
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
return 0; | return 0; |
} | } |
| |
|
int String::compareNoCase(const String& s1, const String& s2) |
|
{ |
|
const Char16* _s1 = s1.getData(); |
|
const Char16* _s2 = s2.getData(); |
|
|
|
while (*_s1 && *_s2) |
|
{ |
|
int r; |
|
|
|
#ifdef PEGASUS_HAS_EBCDIC |
|
if (*_s1 <= 255 && *_s2 <= 255) |
|
#else |
|
if (*_s1 <= 127 && *_s2 <= 127) |
|
#endif |
|
{ |
|
r = tolower(*_s1++) - tolower(*_s2++); |
|
} |
|
else |
|
{ |
|
r = *_s1++ - *_s2++; |
|
} |
|
|
|
if (r) |
|
return r; |
|
} |
|
|
|
if (*_s2) |
|
return -1; |
|
else if (*_s1) |
|
return 1; |
|
|
|
return 0; |
|
} |
|
|
Boolean String::equal(const String& str1, const String& str2) | Boolean String::equal(const String& str1, const String& str2) |
{ | { |
if (str1.size() != str2.size()) | if (str1.size() != str2.size()) |