Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6regex.h
Go to the documentation of this file.
1 
10 #ifndef P6REGEX_H__
11 #define P6REGEX_H__ 1
12 
13 #include "p6err.h"
14 #include "p6comdef.h"
15 
16 
17 
18 #ifdef __cplusplus
19 namespace P6R {
20 extern "C" {
21 #endif
22 
36 typedef enum {
42 } P6REGEXMODE;
43 
84 static const P6REGEXMODIFIER P6MODIFIER_NULL = 0x00000000;
85 static const P6REGEXMODIFIER P6MODIFIER_INSENSITIVE = 0x00000001;
86 static const P6REGEXMODIFIER P6MODIFIER_MULTILINE = 0x00000002;
87 static const P6REGEXMODIFIER P6MODIFIER_NEWLINE = 0x00000004;
88 static const P6REGEXMODIFIER P6MODIFIER_FASTGREEDY = 0x00000008;
89 static const P6REGEXMODIFIER P6MODIFIER_GLOBAL = 0x00000010;
90 static const P6REGEXMODIFIER P6MODIFIER_FULLLOOKBEHIND = 0x00000020;
91 static const P6REGEXMODIFIER P6MODIFIER_SKIPWHITESPACE = 0x00000040;
92 
105 static const P6REGEXTRACELEVEL P6REGEX_TRACE_OFF = 0x00000000;
106 static const P6REGEXTRACELEVEL P6REGEX_TRACE_BASIC = 0x00000001;
107 static const P6REGEXTRACELEVEL P6REGEX_TRACE_DEBUG = 0x00000002;
108 
116 static const P6REGEXFLAGS P6REGEX_NOFLAGS = 0x00000000;
117 
122 typedef const P6CHAR* (*P6REGEXREPLACECB)( const P6CHAR* pMatchedText, P6VOID *pCtx );
123 
124 
131 #undef INTERFACE
132 #define INTERFACE p6IRegexMatch
134 {
147  P6DECLCOMMETHOD(next)(P6THIS_ const P6CHAR** pResult ) P6PURE;
148 
157  P6DECLCOMMETHOD(reset)(P6THIS) P6PURE;
158 };
159 #define IF_p6IRegexMatch {0xE7334DA2,0xAECB,0x46B5,{0xB3,0x73,0xBD,0xFC,0x2B,0x3B,0x96,0xC0}}
160 
161 
174 #undef INTERFACE
175 #define INTERFACE p6IRegex
177 {
189  P6DECLCOMMETHOD(initialize)(P6THIS_ P6REGEXFLAGS flags, P6REGEXMODE mode ) P6PURE;
190 
201  P6DECLCOMMETHOD(setTrace)(P6THIS_ P6REGEXTRACELEVEL level ) P6PURE;
202 
221  P6DECLCOMMETHOD(compile)(P6THIS_ const P6CHAR* pRegex, P6REGEXMODIFIER modifiers ) P6PURE;
222 
247  P6DECLCOMMETHOD(match)(P6THIS_ const P6CHAR* pMatch, P6REGEXMODIFIER modifiers ) P6PURE;
248 
293  P6DECLCOMMETHOD(search)(P6THIS_ const P6CHAR* pSearch,
294  P6REGEXMODIFIER modifiers,
295  P6UINT32* pOffset,
296  P6UINT32* pLength
297  ) P6PURE;
298 
328  P6DECLCOMMETHOD(replace)(P6THIS_ const P6CHAR* pSearch,
329  P6REGEXMODIFIER modifiers,
330  const P6CHAR* pReplace,
331  P6CHAR* pResult,
332  P6UINT32 cBuffer,
333  P6UINT32* pWritten
334  ) P6PURE;
335 
359  P6DECLCOMMETHOD(replaceInPlace)(P6THIS_ P6CHAR* pSearch,
360  P6REGEXMODIFIER modifiers,
361  const P6CHAR* pReplace,
362  P6UINT32* pSize
363  ) P6PURE;
364 
397  P6DECLCOMMETHOD(replaceWithCallback)(P6THIS_ const P6CHAR* pSearch,
398  P6REGEXMODIFIER modifiers,
399  P6REGEXREPLACECB pfn,
400  P6VOID* pCtx,
401  p6IRegexMatch** pResult
402  ) P6PURE;
403 
423  P6DECLCOMMETHOD(getCaptureText)(P6THIS_ P6UINT32 index, P6UINT32* pOffset, P6UINT32* pLength ) P6PURE;
424 
445  P6DECLCOMMETHOD(getNamedCaptureText)(P6THIS_ const P6CHAR* pName, P6UINT32* pOffset, P6UINT32* pLength ) P6PURE;
446 
466  P6DECLCOMMETHOD(setBackTrackLimits)(P6THIS_ P6UINT32 maxBackStack, P6UINT32 maxBackTracks ) P6PURE;
467 };
468 
469 // {14FC8F04-F531-4ab1-9A9E-F8002AC35EDB}
470 #define IF_p6IRegex {0x14fc8f04,0xf531,0x4ab1,{0x9a,0x9e,0xf8,0x0,0x2a,0xc3,0x5e,0xdb}}
471 
472 // {35FA0ABF-90FF-481d-91D6-74E1D1B1D6F8}
473 #define COMP_p6Regex {0x35fa0abf,0x90ff,0x481d,{0x91,0xd6,0x74,0xe1,0xd1,0xb1,0xd6,0xf8}}
474 
475 #ifdef __cplusplus
476 }
477 } // namespace
478 #endif
479 
480 
481 #endif
482 
483 
484 
485 
486 
uint32_t P6UINT32
Definition: p6types.h:77
#define P6PURE
Definition: p6defs.h:192
Standard error codes.
Return zero or more strings resulting from a regex operation.
Definition: p6regex.h:133
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
P6COM base interface definitions.
P6REGEXMODE
This type defines the supported compatitbility modes with other regular expression engines...
Definition: p6regex.h:36
const P6CHAR *(* P6REGEXREPLACECB)(const P6CHAR *pMatchedText, P6VOID *pCtx)
Used for the replaceWithCallBack() function.
Definition: p6regex.h:122
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
P6UINT32 P6REGEXTRACELEVEL
flags dedicated to the control of execution tracing
Definition: p6regex.h:104
#define P6THIS_
Definition: p6defs.h:193
P6UINT32 P6REGEXMODIFIER
This type defines how to modify (or adjust) the matching process.
Definition: p6regex.h:83
This interface provides access the to the narrow string regular expression engine and supports both P...
Definition: p6regex.h:176
void P6VOID
Definition: p6types.h:109
#define P6THIS
Definition: p6defs.h:194
P6UINT32 P6REGEXFLAGS
P6REGEXFLAGS.
Definition: p6regex.h:115
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188