ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc.. Fossies Dox: ucommon-7.0.0.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 19 #include <ucommon-config.h> 39 regex_t *r = (regex_t *)malloc(
sizeof(regex_t));
40 if(regcomp(r, pattern, 0)) {
47 results = (regmatch_t *)malloc(
sizeof(regmatch_t) *
size);
58 results = (regmatch_t *)malloc(
sizeof(regmatch_t) *
size);
61 object = results = NULL;
70 regfree((regex_t *)
object);
73 regex_t *r = (regex_t *)malloc(
sizeof(regex_t));
74 if(regcomp(r, pattern, 0)) {
93 regfree((regex_t *)
object);
98 object = results = NULL;
108 regmatch_t *r = (regmatch_t *)results;
112 return (
size_t)r[member].rm_so;
124 regmatch_t *r = (regmatch_t *)results;
129 if(r[member].rm_so == -1)
132 return (
size_t)(r[member].rm_eo - r[member].rm_so);
146 if(!text || !
object || !results)
149 if(regexec((regex_t *)
object, text,
count, (regmatch_t *)results, flags))
170 if(expr.
size(member) == 0)
196 while(member < expr.
members()) {
197 ssize_t tcl = expr.
size(member);
206 adjust += (cpl - tcl);
226 int prior = 0, match = 0;
227 size_t tcl = strlen(
string);
230 if(!expr.
match(
string, flags))
239 add(tmp + (
size_t)prior);
242 prior = (int)(match + tcl);
245 add(tmp + (
size_t)prior);
void cut(size_t offset, size_t size=0)
size_t offset(const char *pointer) const
bool match(const char *text, unsigned flags=0)
bool operator*=(const char *string)
unsigned replace(const char *string, const char *text=NULL, unsigned flags=0)
const char * search(const char *string, unsigned instance=0, unsigned flags=0) const
regex & operator=(const char *string)
size_t offset(unsigned member)
regex(const char *pattern, size_t size=1)
void add(const char *text)
size_t size(unsigned member)
size_t members(void) const
void paste(size_t offset, const char *text, size_t size=0)
static char * dup(const char *text)
bool operator*=(const char *substring)