forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsedAddress.h
More file actions
49 lines (38 loc) · 998 Bytes
/
sedAddress.h
File metadata and controls
49 lines (38 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Filename: sedAddress.h
// Created by: drose (24Oct00)
//
////////////////////////////////////////////////////////////////////
#ifndef SEDADDRESS_H
#define SEDADDRESS_H
#include "ppremake.h"
#include <sys/types.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#else
#include "gnu_regex.h"
#endif
class SedContext;
///////////////////////////////////////////////////////////////////
// Class : SedAddress
// Description : This represents a single address in a sed command,
// something like a line number or a regular expression.
////////////////////////////////////////////////////////////////////
class SedAddress {
public:
SedAddress();
~SedAddress();
bool parse_address(const string &line, size_t &p);
bool matches(const SedContext &context) const;
bool precedes(const SedContext &context) const;
private:
enum AddressType {
AT_invalid,
AT_numeric,
AT_last,
AT_re,
};
AddressType _address_type;
int _number;
regex_t _re;
};
#endif