Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6split.h
Go to the documentation of this file.
1 
12 #ifndef P6SPLIT_H__
13 #define P6SPLIT_H__ 1
14 
15 #include "p6err.h"
16 #include "p6comdef.h"
17 #include "p6regex.h"
18 
19 
20 namespace P6R {
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
34 const P6SPLITFLAGS P6SPLIT_NOFLAGS = 0x00000000;
35 
43 typedef struct
44 {
45  P6UINT32 offset; // -> start of chunk
46  P6UINT32 length; // -> length of chunk in characters
47 } P6SPLITCHUNK;
48 
49 
59 {
74  P6COMMETHOD next( P6UINT32 cElements, P6SPLITCHUNK* parElements, P6UINT32* pcReturned ) = 0;
75 
84  P6COMMETHOD reset() = 0;
85 };
86 #define IF_p6IEnumSplitChunks {0x3ee8153e,0xba3,0x4ced,{0x86,0xf3,0xd2,0xfe,0xcb,0x4c,0x2,0x6a}}
87 
88 
98 interface p6ISplit : p6ICom
99 {
110  P6COMMETHOD initialize( P6SPLITFLAGS flags ) = 0;
111 
140  P6COMMETHOD split( const P6CHAR* pRegex,
141  P6REGEXMODIFIER modifiers,
142  const P6CHAR* pTargetStr,
143  P6UINT32 chunkLimit,
144  p6IEnumSplitChunks** ppEnum ) = 0;
145 
164  P6COMMETHOD explode( const P6CHAR* pDelimiter,
165  const P6CHAR* pString,
166  P6UINT32 limit,
167  p6IEnumSplitChunks** ppEnum ) = 0;
168 };
169 
170 // {E60619FA-0D30-45de-8DEF-F844D8224824}
171 #define IF_p6ISplit {0xe60619fa,0xd30,0x45de,{0x8d,0xef,0xf8,0x44,0xd8,0x22,0x48,0x24}}
172 
173 // {745F117C-F74F-4cdd-859A-705F0C203759}
174 #define COMP_p6Split {0x745f117c,0xf74f,0x4cdd,{0x85,0x9a,0x70,0x5f,0xc,0x20,0x37,0x59}}
175 
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 } // namespace
182 
183 #endif
184 
185 
186 
virtual P6R::P6ERR next(P6UINT32 cElements, P6SPLITCHUNK *parElements, P6UINT32 *pcReturned)=0
This method is used to iterate the parsed chunks from the original target string. ...
virtual P6R::P6ERR split(const P6CHAR *pRegex, P6REGEXMODIFIER modifiers, const P6CHAR *pTargetStr, P6UINT32 chunkLimit, p6IEnumSplitChunks **ppEnum)=0
A narrow character split parsing funtion.
unsigned int P6UINT32
Definition: p6types.h:40
Each chunk is defined as an offset into the orginal target string and a length of that chunk...
Definition: p6split.h:43
Standard error codes.
virtual P6R::P6ERR initialize(P6SPLITFLAGS flags)=0
This function ensures that this object is in its proper initial state.
virtual P6R::P6ERR explode(const P6CHAR *pDelimiter, const P6CHAR *pString, P6UINT32 limit, p6IEnumSplitChunks **ppEnum)=0
Similar to the PHP explode() function.
P6UINT32 offset
Definition: p6split.h:45
const P6SPLITFLAGS P6SPLIT_NOFLAGS
Definition: p6split.h:34
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
P6COM base interface definitions.
P6UINT32 length
Definition: p6split.h:46
This interface provides a narrow version of a simplified version of Perl's Split function.
Definition: p6split.h:98
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR reset()=0
This method is used to re-start the enumerator at the beginning.
P6UINT32 P6REGEXMODIFIER
This type defines how to modify (or adjust) the matching process.
Definition: p6regex.h:83
P6UINT32 P6SPLITFLAGS
P6SPLITFLAGS.
Definition: p6split.h:33
Interface definition for the Regular Expression Engine.
char P6CHAR
Narrow character type.
Definition: p6types.h:71
Given to an application as a result of a call to p6ISplit::split() or p6ISplit::explode().
Definition: p6split.h:58