Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRegexp.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Fons Rademakers 04/08/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TRegexp
13#define ROOT_TRegexp
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TRegexp //
19// //
20// Declarations for regular expression class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "Rtypes.h"
25
26#include "Match.h"
27
28class TString;
29
30
31class TRegexp {
32
33public:
35
36private:
37 Pattern_t *fPattern; // Compiled pattern
38 EStatVal fStat; // Status
39 static const unsigned fgMaxpat; // Max length of compiled pattern
40
41 void CopyPattern(const TRegexp& re);
42 void GenPattern(const char *re);
43 const char *MakeWildcard(const char *re);
44
45public:
46 TRegexp(const char *re, Bool_t wildcard = kFALSE);
47 TRegexp(const TString& re);
48 TRegexp(const TRegexp& re);
49 virtual ~TRegexp();
50
51 TRegexp& operator=(const TRegexp& re);
52 TRegexp& operator=(const TString& re); // Recompiles pattern
53 TRegexp& operator=(const char *re); // Recompiles pattern
54 Ssiz_t Index(const TString& str, Ssiz_t *len, Ssiz_t start=0) const;
55 EStatVal Status(); // Return & clear status
56
57 ClassDef(TRegexp,0) // Regular expression class
58};
59
60#endif
unsigned short Pattern_t
Definition Match.h:24
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Regular expression class.
Definition TRegexp.h:31
Pattern_t * fPattern
Definition TRegexp.h:37
EStatVal Status()
Check status of regexp.
Definition TRegexp.cxx:235
EStatVal fStat
Definition TRegexp.h:38
void CopyPattern(const TRegexp &re)
Copy the regular expression pattern.
Definition TRegexp.cxx:131
static const unsigned fgMaxpat
Definition TRegexp.h:39
virtual ~TRegexp()
Destructor.
Definition TRegexp.cxx:81
TRegexp & operator=(const TRegexp &re)
Assignment operator.
Definition TRegexp.cxx:89
const char * MakeWildcard(const char *re)
This routine transforms a wildcarding regular expression into a general regular expression used for p...
Definition TRegexp.cxx:148
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
Definition TRegexp.cxx:213
@ kToolong
Definition TRegexp.h:34
@ kIllegal
Definition TRegexp.h:34
@ kNomem
Definition TRegexp.h:34
@ kOK
Definition TRegexp.h:34
void GenPattern(const char *re)
Generate the regular expression pattern.
Definition TRegexp.cxx:121
Basic string class.
Definition TString.h:139