diff options
author | albert <albert@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
commit | a817f5de12611ec73085eba17f8ec7740a46bdb7 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/uri/common.cpp | |
parent | 9f25ef3232c288ca664ceee6c376cf64e4349a2e (diff) | |
download | ydb-a817f5de12611ec73085eba17f8ec7740a46bdb7.tar.gz |
Restoring authorship annotation for <albert@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/uri/common.cpp')
-rw-r--r-- | library/cpp/uri/common.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/uri/common.cpp b/library/cpp/uri/common.cpp index 3f91c34cad3..05af1e57d18 100644 --- a/library/cpp/uri/common.cpp +++ b/library/cpp/uri/common.cpp @@ -1,11 +1,11 @@ -#include "common.h" +#include "common.h" -#include <util/generic/map.h> +#include <util/generic/map.h> #include <util/generic/singleton.h> -namespace NUri { +namespace NUri { static_assert(TFeature::FeatureMAX <= sizeof(unsigned long) * 8, "expect TFeature::FeatureMAX <= sizeof(unsigned long) * 8"); - + const TSchemeInfo TSchemeInfo::Registry[] = { TSchemeInfo(TScheme::SchemeEmpty, TStringBuf()), // scheme is empty and inited TSchemeInfo(TScheme::SchemeHTTP, TStringBuf("http"), TField::FlagHost | TField::FlagPath, 80), @@ -17,18 +17,18 @@ namespace NUri { // add above TSchemeInfo(TScheme::SchemeUnknown, TStringBuf()) // scheme is empty and uninited }; - + namespace { struct TLessNoCase { bool operator()(const TStringBuf& lt, const TStringBuf& rt) const { return 0 > CompareNoCase(lt, rt); } }; - + class TSchemeInfoMap { typedef TMap<TStringBuf, TScheme::EKind, TLessNoCase> TdMap; TdMap Map_; - + public: TSchemeInfoMap() { for (int i = TScheme::SchemeEmpty; i < TScheme::SchemeUnknown; ++i) { @@ -36,7 +36,7 @@ namespace NUri { Map_.insert(std::make_pair(info.Str, info.Kind)); } } - + TScheme::EKind Get(const TStringBuf& scheme) const { const TdMap::const_iterator it = Map_.find(scheme); return Map_.end() == it ? TScheme::SchemeUnknown : it->second; @@ -51,7 +51,7 @@ namespace NUri { const TSchemeInfo& TSchemeInfo::Get(const TStringBuf& scheme) { return Registry[TSchemeInfoMap::Instance().Get(scheme)]; - } + } const char* ParsedStateToString(const TState::EParsed& t) { switch (t) { @@ -79,7 +79,7 @@ namespace NUri { return "Parsed[Unknown]"; } } - + const char* FieldToString(const TField::EField& t) { switch (t) { case TField::FieldScheme: |