diff options
author | socialgraph <socialgraph@yandex-team.com> | 2022-08-10 10:20:58 +0300 |
---|---|---|
committer | socialgraph <socialgraph@yandex-team.com> | 2022-08-10 10:20:58 +0300 |
commit | 07163912675dd114719ec1090ae095355b51ad75 (patch) | |
tree | f1565a4d1ebbf8897749ff2425c14d79ebf43c19 /library/cpp/uri/common.h | |
parent | a1b5c2e7f704c40f99d96b1df8ccdb75b05a40df (diff) | |
download | ydb-07163912675dd114719ec1090ae095355b51ad75.tar.gz |
ui32 not enough for features flag
Так как добавил новый флаг, отвечающий за оставление хэшбенга, то Feature флаги перестали помещаться в свои прежние 32 бита, то везде поменял long на ui64
Diffstat (limited to 'library/cpp/uri/common.h')
-rw-r--r-- | library/cpp/uri/common.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/library/cpp/uri/common.h b/library/cpp/uri/common.h index 80253577635..27c559a55bf 100644 --- a/library/cpp/uri/common.h +++ b/library/cpp/uri/common.h @@ -30,6 +30,7 @@ namespace NUri { FIELD_NAME(Path), FIELD_NAME(Query), FIELD_NAME(Frag), + FIELD_NAME(HashBang), // add fields above FieldUrlMAX, @@ -121,7 +122,7 @@ namespace NUri { #define FEATURE_NAME(f) _BitFeature##f #define FEATURE_FLAG_NAME(f) Feature##f -#define FEATURE_FLAG(f) FEATURE_FLAG_NAME(f) = 1UL << FEATURE_NAME(f) +#define FEATURE_FLAG(f) FEATURE_FLAG_NAME(f) = 1ULL << FEATURE_NAME(f) protected: enum EBit { @@ -251,19 +252,15 @@ namespace NUri { // internal usage: decode all encoded symbols FEATURE_NAME(DecodeANY), + // move and encode #! fragment after the query + FEATURE_NAME(FragmentToHashBang), + // add before this line _FeatureMAX }; - protected: - enum EPrivate : ui32 { - FEATURE_FLAG(DecodeANY), - FEATURE_FLAG(DecodeFieldAllowed), - FEATURE_FLAG(DecodeStandardExtra), - }; - public: - enum EPublic : ui32 { + enum EPublic : ui64 { FeatureMAX = _FeatureMAX, FEATURE_FLAG(AuthSupported), FEATURE_FLAG(SchemeKnown), @@ -283,6 +280,7 @@ namespace NUri { FEATURE_FLAG(DecodeExtendedDelim), FEATURE_FLAG(EncodeCntrl), FEATURE_FLAG(EncodePercent), + FEATURE_FLAG(FragmentToHashBang), FEATURE_FLAG(HashBangToEscapedFragment), FEATURE_FLAG(EscapedToHashBangFragment), FEATURE_FLAG(PathDenyRootParent), @@ -296,6 +294,9 @@ namespace NUri { FEATURE_FLAG(NoRelPath), FEATURE_FLAG_NAME(HierURI) = FEATURE_FLAG_NAME(NoRelPath), FEATURE_FLAG(UpperEncoded), + FEATURE_FLAG(DecodeANY), + FEATURE_FLAG(DecodeFieldAllowed), + FEATURE_FLAG(DecodeStandardExtra), }; #undef FEATURE_NAME @@ -303,7 +304,7 @@ namespace NUri { public: //============================== - enum ESets { + enum ESets : ui64 { // these are guaranteed and will change buffer size FeatureDecodeStandard = 0 | FeatureDecodeUnreserved | FeatureDecodeStandardExtra, @@ -442,7 +443,7 @@ namespace NUri { #define FEATURE_NAME(f) _BitFeature##f #define FEATURE_FLAG_NAME(f) Feature##f -#define FEATURE_FLAG(f) FEATURE_FLAG_NAME(f) = 1UL << FEATURE_NAME(f) +#define FEATURE_FLAG(f) FEATURE_FLAG_NAME(f) = 1ULL << FEATURE_NAME(f) struct TQueryArg { TStringBuf Name; |