const zfchar *ZFFilterCallbackResultFromString(ZF_OUT ZFFilterCallbackResult &ret,
                                               ZF_IN const zfchar *src,
                                               ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFFilterCallbackResultNotSpecified,
        ZFTOKEN_ZFFilterCallbackResultActive,
        ZFTOKEN_ZFFilterCallbackResultNotActive,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFMACRO_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFFilterCallbackResultNotSpecified;
    switch(matched)
    {
        case 0:
            ret = ZFFilterCallbackResultNotSpecified;
            return zfnull;
        case 1:
            ret = ZFFilterCallbackResultActive;
            return zfnull;
        case 2:
            ret = ZFFilterCallbackResultNotActive;
            return zfnull;
        default:
            return src;
    }
}
Beispiel #2
0
const zfchar *ZFMethodPrivilegeTypeFromString(ZF_OUT ZFMethodPrivilegeType &ret,
                                              ZF_IN const zfchar *src,
                                              ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFMethodPrivilegeTypePublic,
        ZFTOKEN_ZFMethodPrivilegeTypeProtected,
        ZFTOKEN_ZFMethodPrivilegeTypePrivate,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFMACRO_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFMethodPrivilegeTypePublic;
    switch(matched)
    {
        case 0:
            ret = ZFMethodPrivilegeTypePublic;
            return zfnull;
        case 1:
            ret = ZFMethodPrivilegeTypeProtected;
            return zfnull;
        case 2:
            ret = ZFMethodPrivilegeTypePrivate;
            return zfnull;
        default:
            return src;
    }
}
Beispiel #3
0
const zfchar *ZFMethodTypeFromString(ZF_OUT ZFMethodType &ret,
                                     ZF_IN const zfchar *src,
                                     ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFMethodTypeClassStatic,
        ZFTOKEN_ZFMethodTypeClassMember,
        ZFTOKEN_ZFMethodTypeRawFunction,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFMACRO_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFMethodTypeRawFunction;
    switch(matched)
    {
        case 0:
            ret = ZFMethodTypeClassStatic;
            return zfnull;
        case 1:
            ret = ZFMethodTypeClassMember;
            return zfnull;
        case 2:
            ret = ZFMethodTypeRawFunction;
            return zfnull;
        default:
            return src;
    }
}
const zfchar *ZFClassFilterTypeFromString(ZF_OUT ZFClassFilterType &ret,
                                          ZF_IN const zfchar *src,
                                          ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFClassFilterTypeInclude,
        ZFTOKEN_ZFClassFilterTypeExclude,
        ZFTOKEN_ZFClassFilterTypeIncludeChildOf,
        ZFTOKEN_ZFClassFilterTypeIncludeChildTypeOf,
        ZFTOKEN_ZFClassFilterTypeIncludeParentOf,
        ZFTOKEN_ZFClassFilterTypeIncludeParentTypeOf,
        ZFTOKEN_ZFClassFilterTypeExcludeChildOf,
        ZFTOKEN_ZFClassFilterTypeExcludeChildTypeOf,
        ZFTOKEN_ZFClassFilterTypeExcludeParentOf,
        ZFTOKEN_ZFClassFilterTypeExcludeParentTypeOf,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFMACRO_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFClassFilterTypeInclude;
    switch(matched)
    {
        case 0:
            ret = ZFClassFilterTypeInclude;
            return zfnull;
        case 1:
            ret = ZFClassFilterTypeExclude;
            return zfnull;
        case 2:
            ret = ZFClassFilterTypeIncludeChildOf;
            return zfnull;
        case 3:
            ret = ZFClassFilterTypeIncludeChildTypeOf;
            return zfnull;
        case 4:
            ret = ZFClassFilterTypeIncludeParentOf;
            return zfnull;
        case 5:
            ret = ZFClassFilterTypeIncludeParentTypeOf;
            return zfnull;
        case 6:
            ret = ZFClassFilterTypeExcludeChildOf;
            return zfnull;
        case 7:
            ret = ZFClassFilterTypeExcludeChildTypeOf;
            return zfnull;
        case 8:
            ret = ZFClassFilterTypeExcludeParentOf;
            return zfnull;
        case 9:
            ret = ZFClassFilterTypeExcludeParentTypeOf;
            return zfnull;
        default:
            return src;
    }
}
const zfchar *ZFFilterTypeFromString(ZF_OUT ZFFilterType &ret,
                                     ZF_IN const zfchar *src,
                                     ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFFilterTypeInclude,
        ZFTOKEN_ZFFilterTypeExclude,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFMACRO_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFFilterTypeInclude;
    switch(matched)
    {
        case 0:
            ret = ZFFilterTypeInclude;
            return zfnull;
        case 1:
            ret = ZFFilterTypeExclude;
            return zfnull;
        default:
            return src;
    }
}
const zfchar *ZFLevelFromString(ZF_OUT ZFLevel &ret,
                                ZF_IN const zfchar *src,
                                ZF_IN_OPT zfindex srcLen /* = zfindexMax */)
{
    const zfchar *tokens[] = {
        ZFTOKEN_ZFLevelZFFrameworkStatic,
        ZFTOKEN_ZFLevelZFFrameworkEssential,
        ZFTOKEN_ZFLevelZFFrameworkHigh,
        ZFTOKEN_ZFLevelZFFrameworkNormal,
        ZFTOKEN_ZFLevelZFFrameworkLow,

        ZFTOKEN_ZFLevelAppEssential,
        ZFTOKEN_ZFLevelAppHigh,
        ZFTOKEN_ZFLevelAppNormal,
        ZFTOKEN_ZFLevelAppLow,

        ZFTOKEN_ZFLevelZFFrameworkPostLow,
        ZFTOKEN_ZFLevelZFFrameworkPostNormal,
        ZFTOKEN_ZFLevelZFFrameworkPostHigh,
        ZFTOKEN_ZFLevelZFFrameworkPostEssential,
        ZFTOKEN_ZFLevelZFFrameworkPostStatic,
    };
    zfindex matched = ZFCoreStringCheckMatch(tokens, ZFM_ARRAY_SIZE(tokens), src, srcLen);
    ret = ZFLevelAppLow;
    switch(matched)
    {
        case 0:
            ret = ZFLevelZFFrameworkStatic;
            return zfnull;
        case 1:
            ret = ZFLevelZFFrameworkEssential;
            return zfnull;
        case 2:
            ret = ZFLevelZFFrameworkHigh;
            return zfnull;
        case 3:
            ret = ZFLevelZFFrameworkNormal;
            return zfnull;
        case 4:
            ret = ZFLevelZFFrameworkLow;
            return zfnull;

        case 5:
            ret = ZFLevelAppEssential;
            return zfnull;
        case 6:
            ret = ZFLevelAppHigh;
            return zfnull;
        case 7:
            ret = ZFLevelAppNormal;
            return zfnull;
        case 8:
            ret = ZFLevelAppLow;
            return zfnull;

        case 9:
            ret = ZFLevelZFFrameworkPostLow;
            return zfnull;
        case 10:
            ret = ZFLevelZFFrameworkPostNormal;
            return zfnull;
        case 11:
            ret = ZFLevelZFFrameworkPostHigh;
            return zfnull;
        case 12:
            ret = ZFLevelZFFrameworkPostEssential;
            return zfnull;
        case 13:
            ret = ZFLevelZFFrameworkPostStatic;
            return zfnull;

        default:
            return src;
    }
}