version 1.68, 2002/09/20 19:38:14
|
version 1.72, 2002/10/05 06:26:24
|
|
|
#ifndef Pegasus_String_h | #ifndef Pegasus_String_h |
#define Pegasus_String_h | #define Pegasus_String_h |
| |
#include <cstring> |
#ifdef PEGASUS_OS_HPUX |
|
# ifdef HPUX_IA64_NATIVE_COMPILER |
#include <iostream> | #include <iostream> |
|
# else |
|
# include <iostream.h> |
|
# endif |
|
#else |
|
# include <iostream> |
|
#endif |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Char16.h> | #include <Pegasus/Common/Char16.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
|
|
*/ | */ |
static Boolean equalNoCase(const String& str1, const String& str2); | static Boolean equalNoCase(const String& str1, const String& str2); |
| |
/** match matches a string against a GLOB style pattern. |
|
Return trues if the String parameter matches the pattern. C-Shell style |
|
glob matching is used. |
|
@param str String to be matched against the pattern |
|
@param pattern Pattern to use in the match |
|
@return Boolean true if str matches pattern |
|
The pattern definition is as follows: |
|
<pre> |
|
* Matches any number of any characters |
|
? Match exactly one character |
|
[chars] Match any character in chars |
|
[chara-charb] Match any character in the range between chara and charb |
|
</pre> |
|
The literal characters *, ?, [, ] can be included in a string by |
|
escaping them with backslash "\". Ranges of characters can be concatenated. |
|
<pre> |
|
examples: |
|
Boolean result = String::match("This is a test", "*is*"); |
|
Boolean works = String::match("abcdef123", "*[0-9]"); |
|
</pre> |
|
*/ |
|
static Boolean match(const String& str, const String& pattern); |
|
|
|
/** matchNoCase Matches a String against a GLOB style pattern independent |
|
of case. |
|
Returns true if the str parameter matches the pattern. C-Shell style |
|
glob matching is used. Ignore case in all comparisons. Case is |
|
ignored in the match. |
|
@parm str String containing the string to be matched\ |
|
@parm pattern GLOB style patterh to use in the match. |
|
@return Boolean true if str matches patterh |
|
@SeeAlso match |
|
*/ |
|
static Boolean matchNoCase(const String& str, const String& pattern); |
|
|
|
private: | private: |
| |
StringRep* _rep; | StringRep* _rep; |