home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / V1 < prev    next >
Encoding:
Text File  |  1992-06-07  |  1.6 KB  |  59 lines

  1. #ifndef __RWREGEXP_H__
  2. #define __RWREGEXP_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for class RWRegexp --- Regular Expression
  7.  *
  8.  * $Header:   E:/vcs/rw/regexp.h_v   1.3   04 Mar 1992 10:22:14   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave Software, Inc.
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * $Log:   E:/vcs/rw/regexp.h_v  $
  23.  * 
  24.  *    Rev 1.3   04 Mar 1992 10:22:14   KEFFER
  25.  * RWString -> RWCString
  26.  * 
  27.  *    Rev 1.1   28 Oct 1991 09:08:20   keffer
  28.  * Changed inclusions to <rw/xxx.h>
  29.  * 
  30.  *    Rev 1.0   28 Jul 1991 08:16:10   keffer
  31.  * Tools.h++ V4.0.5 PVCS baseline version
  32.  *
  33.  */
  34.  
  35. #include "rw/defs.h"
  36. class RWExport RWCString;
  37.  
  38. class RWExport RWRegexp {
  39. public:
  40.   enum statVal {OK=0, ILLEGAL, TOOLONG};
  41.   RWRegexp(const char*);
  42.   RWRegexp(const RWRegexp&);
  43.   ~RWRegexp();
  44.  
  45.   RWRegexp&        operator=(const RWRegexp&);
  46.   RWRegexp&        operator=(const char*);    // Recompiles pattern
  47.   int            index(const RWCString& str, int* len, int start=0) const;
  48.   statVal        status();    // Return & clear status
  49. private:
  50.   void            copyPattern(const RWRegexp&);
  51.   void            genPattern(const char*);
  52.   unsigned char*    thePattern;    // Compiled pattern
  53.   statVal        stat;        // Status
  54.   static const unsigned maxpat;        // Max length of compiled pattern
  55. };
  56.  
  57. pragma pop_align_members();
  58. #endif /* __RWREGEXP_H__ */
  59.