00001
00010 #ifndef P6WREGEX_H__
00011 #define P6WREGEX_H__ 1
00012
00013 #include "p6err.h"
00014
00015 namespace P6R {
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00030 typedef enum {
00031 P6WREGEX_PERL,
00032 P6WREGEX_EGREP,
00033 P6WREGEX_MAX
00034 } P6WREGEXMODE;
00035
00075 typedef P6UINT32 P6WREGEXMODIFIER;
00076 const P6WREGEXMODIFIER P6MOD_NULL = 0x00000000;
00077 const P6WREGEXMODIFIER P6MOD_INSENSITIVE = 0x00000001;
00078 const P6WREGEXMODIFIER P6MOD_MULTILINE = 0x00000002;
00079 const P6WREGEXMODIFIER P6MOD_NEWLINE = 0x00000004;
00080 const P6WREGEXMODIFIER P6MOD_FASTGREEDY = 0x00000008;
00081 const P6WREGEXMODIFIER P6MOD_GLOBAL = 0x00000010;
00082 const P6WREGEXMODIFIER P6MOD_FULLLOOKBEHIND = 0x00000020;
00083 const P6WREGEXMODIFIER P6MOD_SKIPWHITESPACE = 0x00000040;
00084
00096 typedef P6UINT32 P6WREGEXTRACELEVEL;
00097 const P6WREGEXTRACELEVEL P6WREGEX_TRACE_OFF = 0x00000000;
00098 const P6WREGEXTRACELEVEL P6WREGEX_TRACE_BASIC = 0x00000001;
00099 const P6WREGEXTRACELEVEL P6WREGEX_TRACE_DEBUG = 0x00000002;
00100
00107 typedef P6UINT32 P6WREGEXFLAGS;
00108 const P6WREGEXFLAGS P6WREGEX_NOFLAGS = 0x00000000;
00109
00114 typedef const P6WCHAR* (*P6WREGEXREPLACECB)( const P6WCHAR* pMatchedText, P6VOID *pCtx );
00115
00116
00123 interface p6IWRegexMatch : p6ICom
00124 {
00138 P6COMMETHOD next( const P6WCHAR** pResult ) = 0;
00139
00148 P6COMMETHOD reset() = 0;
00149 };
00150 #define IF_p6IWRegexMatch {0x25845EAC,0xC253,0x4409,{0x85,0x09,0xD3,0xD7,0xBC,0x9B,0x9D,0xE0}}
00151
00152
00159 interface p6IWRegex : public p6ICom
00160 {
00172 P6COMMETHOD initialize( P6WREGEXFLAGS flags, P6WREGEXMODE mode ) = 0;
00173
00188 P6COMMETHOD setLocale( const P6CHAR* pLocale ) = 0;
00189
00200 P6COMMETHOD setTrace( P6WREGEXTRACELEVEL level ) = 0;
00201
00219 P6COMMETHOD compile( const P6WCHAR* pRegex,
00220 P6WREGEXMODIFIER modifiers
00221 ) = 0;
00222
00246 P6COMMETHOD match( const P6WCHAR* pMatch,
00247 P6WREGEXMODIFIER modifiers
00248 ) = 0;
00249
00271 P6COMMETHOD search( const P6WCHAR* pSearch,
00272 P6WREGEXMODIFIER modifiers,
00273 P6UINT32* pOffset,
00274 P6UINT32* pLength
00275 ) = 0;
00276
00306 P6COMMETHOD replace( const P6WCHAR* pSearch,
00307 P6WREGEXMODIFIER modifiers,
00308 const P6WCHAR* pReplace,
00309 P6WCHAR* pResult,
00310 P6UINT32 cBuffer,
00311 P6UINT32* pWritten
00312 ) = 0;
00313
00339 P6COMMETHOD replaceInPlace( P6WCHAR* pSearch,
00340 P6WREGEXMODIFIER modifiers,
00341 const P6WCHAR* pReplace,
00342 P6UINT32* pSize
00343 ) = 0;
00344
00377 P6COMMETHOD replaceWithCallback( const P6WCHAR* pSearch,
00378 P6WREGEXMODIFIER modifiers,
00379 P6WREGEXREPLACECB pfn,
00380 P6VOID* pCtx,
00381 p6IWRegexMatch** pResult
00382 ) = 0;
00383
00403 P6COMMETHOD getCaptureText( P6UINT32 index,
00404 P6UINT32* pOffset,
00405 P6UINT32* pLength
00406 ) = 0;
00407
00427 P6COMMETHOD setBackTrackLimits( P6UINT32 maxBackStack, P6UINT32 maxBackTracks ) = 0;
00428 };
00429
00430
00431 #define IF_p6IWRegex {0x3e3cf731,0x11ea,0x47c7,{0xa9,0x5a,0xe1,0x51,0x7,0x28,0x62,0x11}}
00432
00433
00434 #define COMP_p6WRegex {0x8cebaed1,0x228d,0x4729,{0xaf,0x59,0x14,0x4,0x80,0xd8,0x97,0xf7}}
00435
00436 #ifdef __cplusplus
00437 }
00438 #endif
00439
00440 }
00441
00442
00443 #endif
00444
00445
00446
00447
00448