aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string/string_builder.h
diff options
context:
space:
mode:
authorarkady-e1ppa <arkady-e1ppa@yandex-team.com>2024-07-02 15:28:09 +0300
committerarkady-e1ppa <arkady-e1ppa@yandex-team.com>2024-07-02 15:40:39 +0300
commit3336f268eb26aa0318cd3fa3f97116c43545f87b (patch)
tree047395a3b7bf0751a86c5676a9c103e168e47e3c /library/cpp/yt/string/string_builder.h
parentaa95a328ada306559bd361a96c5348829d0e562e (diff)
downloadydb-3336f268eb26aa0318cd3fa3f97116c43545f87b.tar.gz
YT-21868: Reorganize files to prevent unclear missing include errors
Moving files around so that include of either `string_builder.h` or `format.h` would result in being able to use both `Format` and `TStringBuilder` 8a2abbea2ae7027c1cd3a243ab3de55bdd5d3d27
Diffstat (limited to 'library/cpp/yt/string/string_builder.h')
-rw-r--r--library/cpp/yt/string/string_builder.h78
1 files changed, 1 insertions, 77 deletions
diff --git a/library/cpp/yt/string/string_builder.h b/library/cpp/yt/string/string_builder.h
index 4cba45bc72..de1c1abb1e 100644
--- a/library/cpp/yt/string/string_builder.h
+++ b/library/cpp/yt/string/string_builder.h
@@ -1,6 +1,6 @@
#pragma once
-#include "format_string.h"
+#include "format.h"
#include <util/generic/string.h>
@@ -8,78 +8,6 @@ namespace NYT {
////////////////////////////////////////////////////////////////////////////////
-// Forward declarations.
-class TStringBuilderBase;
-class TStringBuilder;
-class TDelimitedStringBuilderWrapper;
-
-template <class... TArgs>
-void Format(TStringBuilderBase* builder, TFormatString<TArgs...> fmt, TArgs&&... args);
-
-////////////////////////////////////////////////////////////////////////////////
-
-//! A simple helper for constructing strings by a sequence of appends.
-class TStringBuilderBase
-{
-public:
- virtual ~TStringBuilderBase() = default;
-
- char* Preallocate(size_t size);
-
- void Reserve(size_t size);
-
- size_t GetLength() const;
-
- TStringBuf GetBuffer() const;
-
- void Advance(size_t size);
-
- void AppendChar(char ch);
- void AppendChar(char ch, int n);
-
- void AppendString(TStringBuf str);
- void AppendString(const char* str);
-
- template <size_t Length, class... TArgs>
- void AppendFormat(const char (&format)[Length], TArgs&&... args);
- template <class... TArgs>
- void AppendFormat(TStringBuf format, TArgs&&... args);
-
- void Reset();
-
-protected:
- char* Begin_ = nullptr;
- char* Current_ = nullptr;
- char* End_ = nullptr;
-
- virtual void DoReset() = 0;
- virtual void DoReserve(size_t newLength) = 0;
-
- static constexpr size_t MinBufferLength = 128;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TStringBuilder
- : public TStringBuilderBase
-{
-public:
- TString Flush();
-
-protected:
- TString Buffer_;
-
- void DoReset() override;
- void DoReserve(size_t size) override;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-template <class T>
-TString ToStringViaBuilder(const T& value, TStringBuf spec = TStringBuf("v"));
-
-////////////////////////////////////////////////////////////////////////////////
-
//! Appends a certain delimiter starting from the second call.
class TDelimitedStringBuilderWrapper
: private TNonCopyable
@@ -111,7 +39,3 @@ private:
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT
-
-#define STRING_BUILDER_INL_H_
-#include "string_builder-inl.h"
-#undef STRING_BUILDER_INL_H_