(file) Return to String.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/String.cpp between version 1.64 and 1.65

version 1.64, 2002/09/20 19:57:09 version 1.65, 2002/09/20 22:11:25
Line 543 
Line 543 
 } }
  
  
   #if 0
 // ATTN-RK-P3-20020603: This code is not completely correct // ATTN-RK-P3-20020603: This code is not completely correct
  // Wildcard String matching function that may be useful in the future  // Wildcard String matching function that may be useful in the future
 // The following code was provided by Bob Blair. // The following code was provided by Bob Blair.
Line 665 
Line 666 
 } }
  
  
       /** 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>
       */
 Boolean String::match(const String& str, const String& pattern) Boolean String::match(const String& str, const String& pattern)
 { {
     return _StringMatch(     return _StringMatch(
         (Uint16*)str.getChar16Data(), (Uint16*)pattern.getChar16Data(), 0) != 0;         (Uint16*)str.getChar16Data(), (Uint16*)pattern.getChar16Data(), 0) != 0;
 } }
  
       /** 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
       */
 Boolean String::matchNoCase(const String& str, const String& pattern) Boolean String::matchNoCase(const String& str, const String& pattern)
 { {
     return _StringMatch(     return _StringMatch(
         (Uint16*)str.getChar16Data(), (Uint16*)pattern.getChar16Data(), 1) != 0;         (Uint16*)str.getChar16Data(), (Uint16*)pattern.getChar16Data(), 1) != 0;
 } }
   #endif
  
  
 /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////


Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2