aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/yson_pull
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson_pull')
-rw-r--r--library/cpp/yson_pull/detail/cescape.h22
-rw-r--r--library/cpp/yson_pull/detail/format_string.h6
-rw-r--r--library/cpp/yson_pull/detail/input/stream.h4
-rw-r--r--library/cpp/yson_pull/detail/lexer_base.h2
-rw-r--r--library/cpp/yson_pull/detail/output/stream.h4
-rw-r--r--library/cpp/yson_pull/detail/reader.h2
-rw-r--r--library/cpp/yson_pull/detail/writer.h2
-rw-r--r--library/cpp/yson_pull/exceptions.h8
-rw-r--r--library/cpp/yson_pull/output.cpp2
-rw-r--r--library/cpp/yson_pull/output.h2
-rw-r--r--library/cpp/yson_pull/read_ops.h4
-rw-r--r--library/cpp/yson_pull/ut/cescape_ut.cpp8
-rw-r--r--library/cpp/yson_pull/ut/loop_ut.cpp2
-rw-r--r--library/cpp/yson_pull/ut/writer_ut.cpp12
14 files changed, 40 insertions, 40 deletions
diff --git a/library/cpp/yson_pull/detail/cescape.h b/library/cpp/yson_pull/detail/cescape.h
index 738e8ec32f..1ea150e69a 100644
--- a/library/cpp/yson_pull/detail/cescape.h
+++ b/library/cpp/yson_pull/detail/cescape.h
@@ -6,7 +6,7 @@
#include "macros.h"
#include <util/generic/strbuf.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/generic/vector.h>
/* REFERENCES FOR ESCAPE SEQUENCE INTERPRETATION:
@@ -38,7 +38,7 @@
namespace NYsonPull {
namespace NDetail {
namespace NCEscape {
- inline void encode(TString& dest, TStringBuf data) {
+ inline void encode(TString& dest, TStringBuf data) {
NImpl::escape_impl(
reinterpret_cast<const ui8*>(data.data()),
data.size(),
@@ -78,14 +78,14 @@ namespace NYsonPull {
}
}
- inline TString encode(TStringBuf data) {
- TString result;
+ inline TString encode(TStringBuf data) {
+ TString result;
result.reserve(data.size());
encode(result, data);
return result;
}
- inline void decode(TString& dest, TStringBuf data) {
+ inline void decode(TString& dest, TStringBuf data) {
NImpl::unescape_impl(
reinterpret_cast<const ui8*>(data.begin()),
reinterpret_cast<const ui8*>(data.end()),
@@ -97,7 +97,7 @@ namespace NYsonPull {
});
}
- inline void decode_inplace(TVector<ui8>& data) {
+ inline void decode_inplace(TVector<ui8>& data) {
auto* out = static_cast<ui8*>(
::memchr(data.data(), '\\', data.size()));
if (out == nullptr) {
@@ -116,16 +116,16 @@ namespace NYsonPull {
data.resize(out - &data[0]);
}
- inline TString decode(TStringBuf data) {
- TString result;
+ inline TString decode(TStringBuf data) {
+ TString result;
result.reserve(data.size());
decode(result, data);
return result;
}
ATTRIBUTE(noinline, cold)
- inline TString quote(TStringBuf str) {
- TString result;
+ inline TString quote(TStringBuf str) {
+ TString result;
result.reserve(str.size() + 16);
result += '"';
encode(result, str);
@@ -134,7 +134,7 @@ namespace NYsonPull {
}
ATTRIBUTE(noinline, cold)
- inline TString quote(ui8 ch) {
+ inline TString quote(ui8 ch) {
char c = ch;
return quote(TStringBuf(&c, 1));
}
diff --git a/library/cpp/yson_pull/detail/format_string.h b/library/cpp/yson_pull/detail/format_string.h
index 57bc2697ae..683fd1bf36 100644
--- a/library/cpp/yson_pull/detail/format_string.h
+++ b/library/cpp/yson_pull/detail/format_string.h
@@ -1,7 +1,7 @@
#pragma once
#include <util/generic/strbuf.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <util/string/builder.h>
namespace NYsonPull {
@@ -17,10 +17,10 @@ namespace NYsonPull {
}
template <typename... Args>
- TString format_string(Args&&... args) {
+ TString format_string(Args&&... args) {
TStringBuilder builder;
NImpl::apply_args(builder, std::forward<Args>(args)...);
- return TString(std::move(builder));
+ return TString(std::move(builder));
}
}
}
diff --git a/library/cpp/yson_pull/detail/input/stream.h b/library/cpp/yson_pull/detail/input/stream.h
index abe495aa47..791cd5a3f5 100644
--- a/library/cpp/yson_pull/detail/input/stream.h
+++ b/library/cpp/yson_pull/detail/input/stream.h
@@ -57,10 +57,10 @@ namespace NYsonPull {
}
};
- class TFHandle: public TOwned<TFileInput> {
+ class TFHandle: public TOwned<TFileInput> {
public:
TFHandle(int fd, size_t buffer_size)
- : TOwned<TFileInput>(Duplicate(fd), buffer_size)
+ : TOwned<TFileInput>(Duplicate(fd), buffer_size)
{
}
};
diff --git a/library/cpp/yson_pull/detail/lexer_base.h b/library/cpp/yson_pull/detail/lexer_base.h
index 525304ec8e..572bdb3d18 100644
--- a/library/cpp/yson_pull/detail/lexer_base.h
+++ b/library/cpp/yson_pull/detail/lexer_base.h
@@ -19,7 +19,7 @@ namespace NYsonPull {
using Base = byte_reader<
stream_counter<EnableLinePositionInfo>>;
- TVector<ui8> token_buffer_;
+ TVector<ui8> token_buffer_;
TMaybe<size_t> memory_limit_;
public:
diff --git a/library/cpp/yson_pull/detail/output/stream.h b/library/cpp/yson_pull/detail/output/stream.h
index 4c5ca4db82..d4810f3353 100644
--- a/library/cpp/yson_pull/detail/output/stream.h
+++ b/library/cpp/yson_pull/detail/output/stream.h
@@ -44,10 +44,10 @@ namespace NYsonPull {
}
};
- class TFHandle: public TOwned<TUnbufferedFileOutput> {
+ class TFHandle: public TOwned<TUnbufferedFileOutput> {
public:
TFHandle(int fd, size_t buffer_size)
- : TOwned<TUnbufferedFileOutput>(buffer_size, Duplicate(fd))
+ : TOwned<TUnbufferedFileOutput>(buffer_size, Duplicate(fd))
{
}
};
diff --git a/library/cpp/yson_pull/detail/reader.h b/library/cpp/yson_pull/detail/reader.h
index 655d450b8e..0e02396358 100644
--- a/library/cpp/yson_pull/detail/reader.h
+++ b/library/cpp/yson_pull/detail/reader.h
@@ -188,7 +188,7 @@ namespace NYsonPull {
lexer_base<EnableLinePositionInfo> lexer_;
state state_;
TEvent event_;
- TVector<EEventType> stack_;
+ TVector<EEventType> stack_;
EStreamType mode_;
public:
diff --git a/library/cpp/yson_pull/detail/writer.h b/library/cpp/yson_pull/detail/writer.h
index 4b3238ec33..b24b994292 100644
--- a/library/cpp/yson_pull/detail/writer.h
+++ b/library/cpp/yson_pull/detail/writer.h
@@ -32,7 +32,7 @@ namespace NYsonPull {
};
byte_writer<stream_counter<false>> stream_;
- TVector<EEventType> stack_;
+ TVector<EEventType> stack_;
bool need_item_separator_ = false;
EStreamType mode_ = EStreamType::ListFragment;
state state_ = state::before_begin;
diff --git a/library/cpp/yson_pull/exceptions.h b/library/cpp/yson_pull/exceptions.h
index 2d651990f8..ebfed950a5 100644
--- a/library/cpp/yson_pull/exceptions.h
+++ b/library/cpp/yson_pull/exceptions.h
@@ -2,7 +2,7 @@
#include "position_info.h"
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <stdexcept>
#include <string>
@@ -10,13 +10,13 @@
namespace NYsonPull {
namespace NException {
class TBadStream: public std::exception {
- TString Message_;
+ TString Message_;
TPositionInfo Position_;
- mutable TString FormattedMessage_;
+ mutable TString FormattedMessage_;
public:
TBadStream(
- TString message,
+ TString message,
const TPositionInfo& position)
: Message_(std::move(message))
, Position_(position)
diff --git a/library/cpp/yson_pull/output.cpp b/library/cpp/yson_pull/output.cpp
index 5b01023e37..27c9ef9e69 100644
--- a/library/cpp/yson_pull/output.cpp
+++ b/library/cpp/yson_pull/output.cpp
@@ -20,7 +20,7 @@ THolder<IStream> NOutput::FromPosixFd(int fd, size_t buffer_size) {
return MakeHolder<TFHandle>(fd, buffer_size);
}
-THolder<IStream> NOutput::FromString(TString* output, size_t buffer_size) {
+THolder<IStream> NOutput::FromString(TString* output, size_t buffer_size) {
return MakeHolder<TOwned<TStringOutput>>(buffer_size, *output);
}
diff --git a/library/cpp/yson_pull/output.h b/library/cpp/yson_pull/output.h
index ba1c1bee31..2d78107a93 100644
--- a/library/cpp/yson_pull/output.h
+++ b/library/cpp/yson_pull/output.h
@@ -60,6 +60,6 @@ namespace NYsonPull {
THolder<IStream> FromOutputStream(IOutputStream* output, size_t buffer_size = 65536);
- THolder<IStream> FromString(TString* output, size_t buffer_size = 1024);
+ THolder<IStream> FromString(TString* output, size_t buffer_size = 1024);
}
}
diff --git a/library/cpp/yson_pull/read_ops.h b/library/cpp/yson_pull/read_ops.h
index 125f6c9a57..5c084983ea 100644
--- a/library/cpp/yson_pull/read_ops.h
+++ b/library/cpp/yson_pull/read_ops.h
@@ -119,8 +119,8 @@ namespace NYsonPull {
}
template <>
- inline TString ReadScalar<TString>(TReader& reader) {
- return TString(ReadScalar<TStringBuf>(reader));
+ inline TString ReadScalar<TString>(TReader& reader) {
+ return TString(ReadScalar<TStringBuf>(reader));
}
template <>
diff --git a/library/cpp/yson_pull/ut/cescape_ut.cpp b/library/cpp/yson_pull/ut/cescape_ut.cpp
index d0f65be3fe..6628ba1d15 100644
--- a/library/cpp/yson_pull/ut/cescape_ut.cpp
+++ b/library/cpp/yson_pull/ut/cescape_ut.cpp
@@ -5,7 +5,7 @@
using namespace NYsonPull::NDetail;
namespace {
- void test_roundtrip(const TVector<ui8>& str) {
+ void test_roundtrip(const TVector<ui8>& str) {
TStringBuf str_buf(
reinterpret_cast<const char*>(str.data()),
str.size());
@@ -19,7 +19,7 @@ namespace {
}
template <size_t N>
- void test_exhaustive(TVector<ui8>& str) {
+ void test_exhaustive(TVector<ui8>& str) {
for (int i = 0; i < 256; ++i) {
str[str.size() - N] = static_cast<char>(i);
test_exhaustive<N - 1>(str);
@@ -27,13 +27,13 @@ namespace {
}
template <>
- void test_exhaustive<0>(TVector<ui8>& str) {
+ void test_exhaustive<0>(TVector<ui8>& str) {
test_roundtrip(str);
}
template <size_t N>
void test_exhaustive() {
- TVector<ui8> str(N, ' ');
+ TVector<ui8> str(N, ' ');
test_exhaustive<N>(str);
}
diff --git a/library/cpp/yson_pull/ut/loop_ut.cpp b/library/cpp/yson_pull/ut/loop_ut.cpp
index 361c3df8ca..8c7b11dd1c 100644
--- a/library/cpp/yson_pull/ut/loop_ut.cpp
+++ b/library/cpp/yson_pull/ut/loop_ut.cpp
@@ -215,7 +215,7 @@ namespace {
template <typename Function>
void test_memory(Function make_writer, size_t nrepeat) {
- TString text;
+ TString text;
{
auto writer = make_writer(NYsonPull::NOutput::FromString(&text));
generate(writer, nrepeat);
diff --git a/library/cpp/yson_pull/ut/writer_ut.cpp b/library/cpp/yson_pull/ut/writer_ut.cpp
index da20469697..5c304bad0f 100644
--- a/library/cpp/yson_pull/ut/writer_ut.cpp
+++ b/library/cpp/yson_pull/ut/writer_ut.cpp
@@ -3,7 +3,7 @@
#include <library/cpp/testing/unittest/registar.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <climits>
#include <limits>
@@ -12,8 +12,8 @@ using namespace std::string_view_literals;
namespace {
template <typename Writer, typename Function>
- TString with_writer(Function&& function) {
- TString result;
+ TString with_writer(Function&& function) {
+ TString result;
auto writer = NYsonPull::NDetail::make_writer<Writer>(
NYsonPull::NOutput::FromString(&result),
NYsonPull::EStreamType::Node);
@@ -24,19 +24,19 @@ namespace {
}
template <typename Writer>
- TString to_yson_string(const NYsonPull::TScalar& value) {
+ TString to_yson_string(const NYsonPull::TScalar& value) {
return with_writer<Writer>([&](NYsonPull::TWriter& writer) {
writer.BeginStream().Scalar(value).EndStream();
});
}
template <typename T>
- TString to_yson_binary_string(T&& value) {
+ TString to_yson_binary_string(T&& value) {
return to_yson_string<NYsonPull::NDetail::TBinaryWriterImpl>(std::forward<T>(value));
}
template <typename T>
- TString to_yson_text_string(T&& value) {
+ TString to_yson_text_string(T&& value) {
return to_yson_string<NYsonPull::NDetail::TTextWriterImpl>(std::forward<T>(value));
}