6#ifndef _ZFI_ZFRegExp_h_
7#define _ZFI_ZFRegExp_h_
93 return (this->matched == ref.matched
94 && this->matchedRange == ref.matchedRange
95 && this->namedGroups.objectCompare(ref.namedGroups) ==
ZFCompareEqual);
102#define ZFSerializableKeyword_ZFRegExpResult_matched "matched"
104#define ZFSerializableKeyword_ZFRegExpResult_matchedRange "matchedRange"
106#define ZFSerializableKeyword_ZFRegExpResult_namedGroups "namedGroups"
261 _ZFP_ZFRegExpPrivate *d;
global header for ZFAlgorithm module
#define ZFLIB_ZFAlgorithm
used to export symbols
Definition ZFAlgorithmDef.h:14
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#define zfindexMax()
(zfindex)-1, indicate a max index value, see zfindex
Definition ZFCoreTypeDef_CoreType.h:159
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZFOUTPUT_TYPE(T_Type, outputAction)
declare your custom type conversion to string, convenient for debug
Definition ZFCoreTypeDef_OtherType.h:221
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
@ ZFCompareEqual
Definition ZFCoreTypeDef_OtherType.h:31
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFENUM_REG_FLAGS(ZFLIB_, EnumName, EnumFlagsName,...)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:189
#define ZFENUM_SEPARATOR()
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:158
#define ZFENUM_VALUE_REGISTER(Value)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:168
#define ZFENUM_VALUE_WITH_INIT(Value, initValue)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:154
#define ZFENUM_BEGIN(ZFLIB_, EnumName)
macros to define reflectable enum type
Definition ZFEnumDeclare.h:147
#define ZFENUM_END_FLAGS(ZFLIB_, EnumName, EnumFlagsName)
see ZFENUM_BEGIN
Definition ZFEnumDeclare.h:179
#define ZFMP_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:111
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
see ZFMP_IN
Definition ZFMethod.h:108
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_DECLARE_6(ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3, ZFMP_4, ZFMP_5)
see ZFMethod
Definition ZFMethodDeclare.h:1809
#define ZFMETHOD_DECLARE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1025
#define ZFMETHOD_DECLARE_3(ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMethod
Definition ZFMethodDeclare.h:1206
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZFMETHOD_FUNC_DECLARE_2(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:763
#define ZFMETHOD_FUNC_DECLARE_3(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:910
#define ZFMETHOD_FUNC_DECLARE_4(ZFLIB_, ReturnType, MethodName, ZFMP_0, ZFMP_1, ZFMP_2, ZFMP_3)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:1065
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfcast(T_To, obj)
safely cast ZFObject types, return null if not desired type
Definition ZFObjectCast.h:28
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_2(ZFMP_0, ZFMP_1)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:290
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define zfsuperI(T_SuperType)
class ref to proper super type, see ZFObject for more info
Definition ZFObjectDeclare.h:26
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:169
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
v_ZFRegExpOption::ZFEnumType ZFRegExpOption
see v_ZFRegExpOption
Definition ZFRegExp.h:54
ZFLIB_ZFAlgorithm ZFCoreArray< zfstring > ZFRegExpSplit(const zfchar *src, ZFRegExp *separatorPattern, zfbool keepEmpty=(_ZFT_t_zffalse))
util to split by regexp
#define ZFSerializableKeyword_ZFRegExp_flag
keyword for serialize
Definition ZFRegExp.h:130
ZFLIB_ZFAlgorithm ZFIndexRange ZFRegExpFind(const zfchar *src, ZFRegExp *pattern)
util to find by regexp
ZFLIB_ZFAlgorithm zfstring ZFRegExpReplace(const zfchar *src, ZFRegExp *patternFrom, const zfstring &patternTo, zfindex maxReplaceCount=(((zfindex) -1)))
util to replace by regexp
#define ZFSerializableKeyword_ZFRegExp_pattern
keyword for serialize
Definition ZFRegExp.h:128
#define ZFTYPEID_DECLARE(ZFLIB_, TypeName, Type)
register a type for reflection
Definition ZFTypeIdDeclare.h:137
#define ZFTYPEID_REG(ZFLIB_, TypeName, Type,...)
see ZFTYPEID_DECLARE
Definition ZFTypeIdDeclare.h:151
light weight array
Definition ZFCoreArray.h:331
POD data to hold index range.
Definition ZFCoreTypeDef_OtherType.h:66
regular expression utils
Definition ZFRegExp.h:144
virtual zfbool serializableOnSerializeFromData(const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
for serializable data that has "category" attribute, ZFSerializable would ignore it and leave it to s...
virtual void replace(zfstring &ret, ZFRegExpResult &result, const zfstring &replacePattern, const zfchar *src, zfindex srcLength=(((zfindex) -1)), zfindex maxReplaceCount=(((zfindex) -1)))
replace src with this pattern and replacePattern
virtual zfbool serializableOnSerializeToString(zfstring &ret, zfstring *errorHint=zft_zfnull)
see serializeFromString
virtual void objectOnDealloc(void)
override this to destroy your object
ZFRegExp zfself
class ref to self
Definition ZFRegExp.h:145
virtual void copyableOnCopyFrom(ZFObject *anotherObj)
called by copy to copy contents from anotherObj
Definition ZFRegExp.h:175
virtual ZFCompareResult objectCompareImpl(ZFObject *anotherObj)
ZFCompareEqual if pattern and flag both the same, ZFCompareUncomparable otherwise.
virtual zfindex namedGroupIndexForName(const zfstring &name)
get named group's number which can be used as "$n" while replace, or zfindexMax() if no such group
virtual ZFRegExpOptionFlags options()
get current flag or ZFRegExpOptionNone if not set, use pattern to change
virtual zfbool serializableOnSerializeFromString(const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
see serializeFromString
virtual zfbool serializableOnSerializeToData(ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
corresponding to serializableOnSerializeFromData, return whether the task is success,...
virtual zfidentity objectHashImpl(void)
see objectHash
virtual const zfstring & pattern()
get current pattern or null if not set, use pattern to change
virtual void objectInfoImplAppend(zfstring &ret)
see objectInfo
virtual void objectOnInit(const zfstring &pattern, ZFRegExpOptionFlags flag=(ZFRegExpOptionFlags::EnumDefault()))
init with pattern, see pattern
virtual void * nativeRegExp()
for internal use only
virtual void find(ZFRegExpResult &result, const zfchar *src, zfindex srcLength=(((zfindex) -1)))
test the src with this compiled pattern
see v_ZFRegExpOption, ZFRegExpOptionFlagsToString, ZFRegExpOptionFlagsFromString
Definition ZFRegExp.h:54
static zfuint EnumDefault(void)
default value for ZFRegExpOptionFlags
Definition ZFRegExp.h:54
match result info for ZFRegExp
Definition ZFRegExp.h:61
zfstring objectInfo(void) const
return object info
Definition ZFRegExp.h:84
ZFCoreArray< ZFIndexRange > namedGroups
matched name groups
Definition ZFRegExp.h:78
ZFIndexRange matchedRange
first matched index
Definition ZFRegExp.h:72
zfbool matched
true if matched
Definition ZFRegExp.h:66
void objectInfoT(zfstring &ret) const
see objectInfo
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74