aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/resource/resource.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/resource/resource.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/resource/resource.cpp')
-rw-r--r--library/cpp/resource/resource.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/library/cpp/resource/resource.cpp b/library/cpp/resource/resource.cpp
index a8c2443662c..cc20f847a5f 100644
--- a/library/cpp/resource/resource.cpp
+++ b/library/cpp/resource/resource.cpp
@@ -1,52 +1,52 @@
-#include "resource.h"
#include "resource.h"
-#include "registry.h"
-
-#include <util/generic/yexception.h>
+#include "resource.h"
+#include "registry.h"
+
+#include <util/generic/yexception.h>
#include <util/generic/xrange.h>
-
-using namespace NResource;
-
+
+using namespace NResource;
+
bool NResource::FindExact(const TStringBuf key, TString* out) {
- return CommonStore()->FindExact(key, out);
-}
-
+ return CommonStore()->FindExact(key, out);
+}
+
void NResource::FindMatch(const TStringBuf subkey, TResources* out) {
- struct TMatch: public IMatch {
- inline TMatch(TResources* r)
- : R(r)
- {
- }
-
+ struct TMatch: public IMatch {
+ inline TMatch(TResources* r)
+ : R(r)
+ {
+ }
+
void OnMatch(const TResource& res) override {
- R->push_back(res);
- }
-
- TResources* R;
- };
-
- TMatch m(out);
-
- CommonStore()->FindMatch(subkey, m);
-}
-
+ R->push_back(res);
+ }
+
+ TResources* R;
+ };
+
+ TMatch m(out);
+
+ CommonStore()->FindMatch(subkey, m);
+}
+
TString NResource::Find(const TStringBuf key) {
TString ret;
-
- if (FindExact(key, &ret)) {
- return ret;
- }
-
- ythrow yexception() << "can not find resource with path " << key;
-}
-
+
+ if (FindExact(key, &ret)) {
+ return ret;
+ }
+
+ ythrow yexception() << "can not find resource with path " << key;
+}
+
size_t NResource::Count() noexcept {
- return CommonStore()->Count();
-}
-
-TStringBuf NResource::KeyByIndex(size_t idx) {
- return CommonStore()->KeyByIndex(idx);
-}
+ return CommonStore()->Count();
+}
+
+TStringBuf NResource::KeyByIndex(size_t idx) {
+ return CommonStore()->KeyByIndex(idx);
+}
TVector<TStringBuf> NResource::ListAllKeys() {
TVector<TStringBuf> res(Reserve(NResource::Count()));