aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/small/formatted_output.cpp
diff options
context:
space:
mode:
authoramatanhead <amatanhead@yandex-team.ru>2022-02-10 16:50:04 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:04 +0300
commitb6f3a80f7c2c8b7dbb0c01b056fdc1fd8cd820e9 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/getopt/small/formatted_output.cpp
parent8879605a63ac17539be5b3bd41b529791f4d4b02 (diff)
downloadydb-b6f3a80f7c2c8b7dbb0c01b056fdc1fd8cd820e9.tar.gz
Restoring authorship annotation for <amatanhead@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/getopt/small/formatted_output.cpp')
-rw-r--r--library/cpp/getopt/small/formatted_output.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/library/cpp/getopt/small/formatted_output.cpp b/library/cpp/getopt/small/formatted_output.cpp
index fe355c2723..bf1b366f25 100644
--- a/library/cpp/getopt/small/formatted_output.cpp
+++ b/library/cpp/getopt/small/formatted_output.cpp
@@ -1,36 +1,36 @@
-#include "formatted_output.h"
-
-namespace NLastGetopt {
-
- TFormattedOutput::IndentGuard::IndentGuard(TFormattedOutput* output)
- : Output(output)
- {
- Output->IndentLevel_ += 2;
- }
-
- TFormattedOutput::IndentGuard::~IndentGuard() {
- Output->IndentLevel_ -= 2;
- }
-
- TFormattedOutput::IndentGuard TFormattedOutput::Indent() {
- return IndentGuard(this);
- }
-
- TStringBuilder& TFormattedOutput::Line() {
- return Lines_.emplace_back(IndentLevel_, TStringBuilder()).second;
- }
-
- void TFormattedOutput::Print(IOutputStream& out) {
- for (auto&[indent, line] : Lines_) {
- if (indent && !line.empty()) {
- TTempBuf buf(indent);
- Fill(buf.Data(), buf.Data() + indent, ' ');
- out.Write(buf.Data(), indent);
- }
- out << line;
- if (!line.EndsWith('\n')) {
- out << Endl;
- }
- }
- }
-}
+#include "formatted_output.h"
+
+namespace NLastGetopt {
+
+ TFormattedOutput::IndentGuard::IndentGuard(TFormattedOutput* output)
+ : Output(output)
+ {
+ Output->IndentLevel_ += 2;
+ }
+
+ TFormattedOutput::IndentGuard::~IndentGuard() {
+ Output->IndentLevel_ -= 2;
+ }
+
+ TFormattedOutput::IndentGuard TFormattedOutput::Indent() {
+ return IndentGuard(this);
+ }
+
+ TStringBuilder& TFormattedOutput::Line() {
+ return Lines_.emplace_back(IndentLevel_, TStringBuilder()).second;
+ }
+
+ void TFormattedOutput::Print(IOutputStream& out) {
+ for (auto&[indent, line] : Lines_) {
+ if (indent && !line.empty()) {
+ TTempBuf buf(indent);
+ Fill(buf.Data(), buf.Data() + indent, ' ');
+ out.Write(buf.Data(), indent);
+ }
+ out << line;
+ if (!line.EndsWith('\n')) {
+ out << Endl;
+ }
+ }
+ }
+}