DCL 4.0
Loading...
Searching...
No Matches
_regex.h
Go to the documentation of this file.
1#ifndef __DCL_REGEX_WRAP
2#define __DCL_REGEX_WRAP
3// ref: http://www.boost.org
4
5__DCL_BEGIN_NAMESPACE
6
7class String;
8class ByteString;
9class StringArray;
10class ByteStringArray;
11
12typedef void* regex_handle;
13
15void __regex_destroy(regex_handle _handle);
16
18 regex_icase = 0x0001,
19 regex_nosubs = 0x0002,
21};
22
23// typedef boost::regex_error public std::runtime_error
24// typedef boost::regex_error boost::bad_pattern
26 regex_handle _handle,
27 const wchar_t* _pattern, size_t _n,
28 unsigned int _flags
29 ); // throws(boost::bad_expression&)
30
32{
33 const wchar_t* first;
34 const wchar_t* second;
35 bool matched;
36};
37
42
43void __matches_free(match_result* _results);
44
45size_t __regex_match(
46 regex_handle _handle,
47 const wchar_t* _begin, const wchar_t* _end,
48 match_result** _results, unsigned int _flags
49 ); // throws(std::runtime_error&)
50
51bool __regex_match(
52 regex_handle _handle,
53 const wchar_t* _begin, const wchar_t* _end,
54 unsigned int _flags
55 ); // throws(std::runtime_error&)
56
58 regex_handle _handle,
59 const wchar_t* _begin, const wchar_t* _end,
60 match_result** _results, unsigned int _flags
61 ); // throws(std::runtime_error&)
62
64 regex_handle _handle,
65 const wchar_t* _begin, const wchar_t* _end,
66 unsigned int _flags
67 ); // throws(std::runtime_error&)
68
70 const wchar_t* _regex, const wchar_t* _regexend,
71 const wchar_t* _begin, const wchar_t* _end,
72 bool _icase
74
76 const char* _regex, const char* _regexend,
77 const char* _begin, const char* _end,
78 bool _icase
80
81size_t __regex_search(
82 const wchar_t* _regex, const wchar_t* _regexend,
83 const wchar_t* _begin, const wchar_t* _end,
84 bool _icase
86
87size_t __regex_search(
88 const char* _regex, const char* _regexend,
89 const char* _begin, const char* _end,
90 bool _icase
92
94 const wchar_t* _regex, const wchar_t* _regexend,
95 const wchar_t* _begin, const wchar_t* _end,
96 bool _icase
98
99ByteString __regex_substring(
100 const char* _regex, const char* _regexend,
101 const char* _begin, const char* _end,
102 bool _icase
104
105String __regex_replace(
106 const wchar_t* _regex, const wchar_t* _regexend,
107 const wchar_t* _begin, const wchar_t* _end,
108 const wchar_t* _replacement, const wchar_t* _replacementend,
109 bool _icase,
110 size_t _limit = (size_t)-1
112
113ByteString __regex_replace(
114 const char* _regex, const char* _regexend,
115 const char* _begin, const char* _end,
116 const char* _replacement, const char* _replacementend,
117 bool _icase,
118 size_t _limit = (size_t)-1
120
121StringArray& __regex_split(
122 const wchar_t* _regex, const wchar_t* _regexend,
123 const wchar_t* _begin, const wchar_t* _end,
124 bool _icase,
125 StringArray& _results,
126 size_t _limit = (size_t)-1
128
129ByteStringArray& __regex_split(
130 const char* _regex, const char* _regexend,
131 const char* _begin, const char* _end,
132 bool _icase,
133 ByteStringArray& _results,
134 size_t _limit = (size_t)-1
136
137__DCL_END_NAMESPACE
138
139#endif // __DCL_REGEX_WRAP
140
StringArray & __regex_split(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase, StringArray &_results, size_t _limit=(size_t) -1) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:449
bool __regex_search(regex_handle _handle, const wchar_t *_begin, const wchar_t *_end, match_result **_results, unsigned int _flags)
Definition _regex.cpp:137
void __matches_free(match_result *_results)
Definition _regex.cpp:81
String __regex_substring(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:302
regex_match_flags
Definition _regex.h:38
@ regex_not_bol
Definition _regex.h:39
@ regex_not_eol
Definition _regex.h:40
regex_handle __regex_create()
Definition _regex.cpp:43
regex_compile_flags
Definition _regex.h:17
@ regex_icase
Definition _regex.h:18
@ regex_newline
Definition _regex.h:20
@ regex_nosubs
Definition _regex.h:19
size_t __regex_match(regex_handle _handle, const wchar_t *_begin, const wchar_t *_end, match_result **_results, unsigned int _flags)
Definition _regex.cpp:87
bool __regex_matches(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, bool _icase) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:187
void __regex_compile(regex_handle _handle, const wchar_t *_pattern, size_t _n, unsigned int _flags)
Definition _regex.cpp:61
void __regex_destroy(regex_handle _handle)
Definition _regex.cpp:53
void * regex_handle
Definition _regex.h:12
String __regex_replace(const wchar_t *_regex, const wchar_t *_regexend, const wchar_t *_begin, const wchar_t *_end, const wchar_t *_replacement, const wchar_t *_replacementend, bool _icase, size_t _limit=(size_t) -1) __DCL_THROWS1(RegexException *)
Definition _regex.cpp:367
#define __DCL_THROWS1(e)
Definition Config.h:167
const wchar_t * first
Definition _regex.h:33
const wchar_t * second
Definition _regex.h:34
bool matched
Definition _regex.h:35