aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/detail/stream_counter.h
diff options
context:
space:
mode:
authorMikhail Borisov <borisov.mikhail@gmail.com>2022-02-10 16:45:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:39 +0300
commita6a92afe03e02795227d2641b49819b687f088f8 (patch)
treef6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /library/cpp/yson_pull/detail/stream_counter.h
parentc6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff)
downloadydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson_pull/detail/stream_counter.h')
-rw-r--r--library/cpp/yson_pull/detail/stream_counter.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/yson_pull/detail/stream_counter.h b/library/cpp/yson_pull/detail/stream_counter.h
index 3b41b27eb6..c96698d091 100644
--- a/library/cpp/yson_pull/detail/stream_counter.h
+++ b/library/cpp/yson_pull/detail/stream_counter.h
@@ -1,26 +1,26 @@
-#pragma once
-
+#pragma once
+
#include <library/cpp/yson_pull/position_info.h>
-
-#include <cstddef>
-
+
+#include <cstddef>
+
namespace NYsonPull {
namespace NDetail {
template <bool EnableLinePositionInfo>
class stream_counter;
-
+
template <>
class stream_counter<true> {
private:
size_t offset_ = 0;
size_t line_ = 1;
size_t column_ = 1;
-
+
public:
TPositionInfo info() const {
return {offset_, line_, column_};
}
-
+
void update(const ui8* begin, const ui8* end) {
offset_ += end - begin;
for (auto current = begin; current != end; ++current) {
@@ -30,22 +30,22 @@ namespace NYsonPull {
column_ = 1;
}
}
- }
+ }
};
-
+
template <>
class stream_counter<false> {
private:
size_t offset_ = 0;
-
+
public:
TPositionInfo info() const {
return {offset_, {}, {}};
}
-
+
void update(const ui8* begin, const ui8* end) {
offset_ += end - begin;
}
};
- }
+ }
}