diff options
author | albert <albert@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 9f25ef3232c288ca664ceee6c376cf64e4349a2e (patch) | |
tree | b192eaf3150845f7302fafd460a972b0439d6fe5 /library/cpp/uri/http_url.h | |
parent | 6a1e535429145ec1ecfbc5f1efd3c95323261fb5 (diff) | |
download | ydb-9f25ef3232c288ca664ceee6c376cf64e4349a2e.tar.gz |
Restoring authorship annotation for <albert@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/uri/http_url.h')
-rw-r--r-- | library/cpp/uri/http_url.h | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/library/cpp/uri/http_url.h b/library/cpp/uri/http_url.h index 7c8e8d844d1..70d53c77913 100644 --- a/library/cpp/uri/http_url.h +++ b/library/cpp/uri/http_url.h @@ -1,77 +1,77 @@ #pragma once -#include "uri.h" -#include "other.h" - -// XXX: use NUri::TUri directly; this whole file is for backwards compatibility +#include "uri.h" +#include "other.h" +// XXX: use NUri::TUri directly; this whole file is for backwards compatibility + class THttpURL : public NUri::TUri { -public: - typedef TField::EFlags TFlags; - typedef TField::EField TField; - typedef TScheme::EKind TSchemeKind; - typedef TState::EParsed TParsedState; +public: + typedef TField::EFlags TFlags; + typedef TField::EField TField; + typedef TScheme::EKind TSchemeKind; + typedef TState::EParsed TParsedState; -public: - enum { - FeatureUnescapeStandard = TFeature::FeatureDecodeStandard, +public: + enum { + FeatureUnescapeStandard = TFeature::FeatureDecodeStandard, FeatureEscSpace = TFeature::FeatureEncodeSpaceAsPlus, FeatureEscapeUnescaped = TFeature::FeatureEncodeExtendedASCII, FeatureNormalPath = TFeature::FeaturePathStripRootParent, }; -public: - THttpURL(unsigned defaultPort = 80) - : TUri(defaultPort) +public: + THttpURL(unsigned defaultPort = 80) + : TUri(defaultPort) { } - + THttpURL(const TStringBuf& host, ui16 port, const TStringBuf& path, const TStringBuf& query = TStringBuf(), const TStringBuf& scheme = "http", unsigned defaultPort = 0) - : TUri(host, port, path, query, scheme, defaultPort) + : TUri(host, port, path, query, scheme, defaultPort) { } - THttpURL(const TUri& url) - : TUri(url) + THttpURL(const TUri& url) + : TUri(url) { } - -public: // XXX: don't use any of these legacy methods below -public: // use TUri::GetField() instead - /// will return null-terminated if fld is not dirty + +public: // XXX: don't use any of these legacy methods below +public: // use TUri::GetField() instead + /// will return null-terminated if fld is not dirty const char* Get(EField fld) const { - return GetField(fld).data(); - } - -public: // use TUriUpdate class so that Rewrite() is only called once + return GetField(fld).data(); + } + +public: // use TUriUpdate class so that Rewrite() is only called once void Set(EField field, const TStringBuf& value) { - if (SetInMemory(field, value)) - Rewrite(); - } - - template <size_t size> + if (SetInMemory(field, value)) + Rewrite(); + } + + template <size_t size> void Set(EField field, const char (&value)[size]) { - if (SetInMemory(field, value)) - Rewrite(); - } - -public: // use TUri::FldXXX methods for better control - // Partial quick set of the field, can be called for - // multiple fields + if (SetInMemory(field, value)) + Rewrite(); + } + +public: // use TUri::FldXXX methods for better control + // Partial quick set of the field, can be called for + // multiple fields bool SetInMemory(EField field, const TStringBuf& value) { - return FldMemSet(field, value); - } - - // clears a field + return FldMemSet(field, value); + } + + // clears a field void Reset(EField field) { - FldClr(field); - } + FldClr(field); + } }; - + static inline const char* HttpURLParsedStateToString(const NUri::TState::EParsed& t) { - return NUri::ParsedStateToString(t); -} + return NUri::ParsedStateToString(t); +} static inline const char* HttpUrlSchemeKindToString(const NUri::TScheme::EKind& t) { - return NUri::SchemeKindToString(t); -} + return NUri::SchemeKindToString(t); +} |