13
13
/// with specified initial contents
14
14
CharacterSet(const char *label, const char * const initial);
16
/// define a character set with the given label ("anonymous" if NULL)
17
/// containing characters defined in the supplied ranges
19
CharacterSet(const char *label, unsigned char low, unsigned char high);
16
21
/// whether a given character exists in the set
17
22
bool operator[](unsigned char c) const {return chars_[static_cast<uint8_t>(c)] != 0;}
19
24
/// add a given character to the character set
20
25
CharacterSet & add(const unsigned char c);
27
/// add a list of character ranges, expressed as pairs [low,high], including both ends
28
CharacterSet & addRange(unsigned char low, unsigned char high);
22
30
/// add all characters from the given CharacterSet to this one
23
const CharacterSet &operator +=(const CharacterSet &src);
31
CharacterSet &operator +=(const CharacterSet &src);
33
/// return a new CharacterSet containing the union of two sets
34
CharacterSet operator +(const CharacterSet &src) const;
25
36
/// optional set label for debugging (default: "anonymous")
39
// common character sets, insipired to RFC5234
41
static const CharacterSet ALPHA;
43
static const CharacterSet BIT;
45
static const CharacterSet CR;
47
static const CharacterSet LF;
49
static const CharacterSet DQUOTE;
51
static const CharacterSet DIGIT;
53
static const CharacterSet HEXDIG;
55
static const CharacterSet HTAB;
57
static const CharacterSet SP;
58
// visible (printable) characters
59
static const CharacterSet VCHAR;
61
static const CharacterSet WSP;
62
// character sets from draft httpbis
63
// any VCHAR except for SPECIAL
64
static const CharacterSet TCHAR;
66
static const CharacterSet SPECIAL;
67
// qdtext (ready but not enabled as it requires a c++11 constructor)
68
//static const CharacterSet QDTEXT;
69
// obs-text (ready but not enabled as it requires a c++11 constructor)
70
//static const CharacterSet OBSTEXT;
29
73
/** index of characters in this set