ROOT
6.07/01
Reference Guide
|
Go to the source code of this file.
Macros | |
#define | BOL '^' |
#define | EOL '$' |
#define | ANY '.' |
#define | CCL '[' |
#define | CCLEND ']' |
#define | NCCL '^' |
#define | CLOSURE '*' |
#define | PCLOSE '+' |
#define | OPT '?' |
#define | ISHEXDIGIT(x) isxdigit((unsigned char)x) |
#define | ISOCTDIGIT(x) ('0'<=(x) && (x)<='7') |
#define | MAPSIZE 16 |
#define | E_NONE 0 |
#define | E_ILLEGAL 1 |
#define | E_NOMEM 2 |
#define | E_PAT 3 |
Enumerations | |
enum | Eaction { kBOL = (0x8000 | '^'), kEOL = (0x8000 | '$'), kANY = (0x8000 | '.'), kCCL = (0x8000 | '['), kOPT = (0x8000 | '?'), kCLOSE = (0x8000 | '*'), kPCLOSE = (0x8000 | '+'), kEND = (0x8000 | 0) } |
Functions | |
void | ADVANCE (const Pattern_t *&pat) |
Advance a pointer into the pattern template to the next pattern element, this is a+1 for all pattern elements but kCCL, where you have to skip past both the kCCL character and the bitmap that follows that character. More... | |
static void | SETBIT (unsigned char b, Pattern_t *map) |
static int | TSTBIT (unsigned char b, const Pattern_t *map) |
static const char * | doccl (Pattern_t *map, const char *src) |
Set bits in the map corresponding to characters specified in the src character class. More... | |
static int | hex2bin (int c) |
Convert the hex digit represented by 'c' to an int. More... | |
static int | oct2bin (int c) |
Convert the hex digit represented by 'c' to an int. More... | |
static int | omatch (const char **strp, size_t *slenp, const Pattern_t *pat, const char *start) |
Match one pattern element, pointed at by pat, against the character at **strp. More... | |
static const char * | patcmp (const char *str, size_t slen, const Pattern_t *pat, const char *start) |
Like strcmp, but compares str against pat. More... | |
static int | esc (const char **s) |
Map escape sequences into their equivalent symbols. More... | |
int | Makepat (const char *exp, Pattern_t *pat, int maxpat) |
Make a pattern template from the string pointed to by exp. More... | |
const char * | Matchs (const char *str, size_t slen, const Pattern_t *pat, const char **startpat) |
Match a string with a pattern. More... | |
#define MAPSIZE 16 |
#define OPT '?' |
Definition at line 38 of file Match.cxx.
Referenced by Makepat(), ROOT::Math::IntegOptionsUtil::Print(), and ROOT::Math::IntegOptionsUtil::PrintDefault().
enum Eaction |
|
static |
|
static |
Map escape sequences into their equivalent symbols.
Return the equivalent ASCII character. *s is advanced past the escape sequence. If no escape sequence is present, the current character is returned and the string is advanced by one. The following are recognized:
\b
backspace\f
formfeed\n
newline\r
carriage return\s
space\t
tab\e
ASCII ESC character ('\033')\DDD
number formed of 1-3 octal digits\xDD
number formed of 1-2 hex digits\^C
C = any letter. Control code
|
static |
int Makepat | ( | const char * | exp, |
Pattern_t * | pat, | ||
int | maxpat | ||
) |
Make a pattern template from the string pointed to by exp.
Stop when \0
is found in exp. The pattern template is assembled in pat whose length is given by maxpat.
Return:
Definition at line 129 of file Match.cxx.
Referenced by TRegexp::GenPattern(), and TTabCom::SetPattern().
Match a string with a pattern.
Definition at line 220 of file Match.cxx.
Referenced by TTabCom::DetermineContext(), and TRegexp::Index().
|
static |
|
static |
Match one pattern element, pointed at by pat, against the character at **strp.
Return 0 on a failure, 1 on success. *strp is advanced to skip over the matched character on a successful match. Closure is handled one level up by patcmp().
"start" points at the character at the left edge of the line. This might not be the same thing as *strp if the search is starting in the middle of the string. An end-of- line anchor matches end of string only.
Definition at line 369 of file Match.cxx.
Referenced by patcmp().
|
static |
Like strcmp, but compares str against pat.
Each element of str is compared with the template until either a mis-match is found or the end of the template is reached. In the former case a 0 is returned; in the latter, a pointer into str (pointing after the last character in the matched pattern) is returned. start points at the first character in the string, which might not be the same thing as str if the search started in the middle of the string.
Definition at line 287 of file Match.cxx.
Referenced by Matchs().