From b86aec41d48f57c105bc913c3258858a9243bae3 Mon Sep 17 00:00:00 2001 From: avogar Date: Tue, 20 Sep 2022 13:54:54 +0000 Subject: [PATCH] Remove unused file after renaming --- .../Formats/IOutputFormatWithUTF8Validation.h | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/Processors/Formats/IOutputFormatWithUTF8Validation.h diff --git a/src/Processors/Formats/IOutputFormatWithUTF8Validation.h b/src/Processors/Formats/IOutputFormatWithUTF8Validation.h deleted file mode 100644 index 628242528ff..00000000000 --- a/src/Processors/Formats/IOutputFormatWithUTF8Validation.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include -#include - -#include -#include - -namespace DB -{ - -template -class IIOutputFormatWithUTF8Validation : public Base -{ -public: - IIOutputFormatWithUTF8Validation(bool validate_utf8, const Block & header, WriteBuffer & out_, Args... args) - : Base(header, out_, std::forward(args)...) - { - bool values_can_contain_invalid_utf8 = false; - for (const auto & type : this->getPort(IOutputFormat::PortKind::Main).getHeader().getDataTypes()) - { - if (!type->textCanContainOnlyValidUTF8()) - values_can_contain_invalid_utf8 = true; - } - - if (validate_utf8 && values_can_contain_invalid_utf8) - { - validating_ostr = std::make_unique(this->out); - ostr = validating_ostr.get(); - } - else - ostr = &this->out; - } - - void flush() override - { - ostr->next(); - - if (validating_ostr) - this->out.next(); - } - -protected: - /// Point to validating_ostr or out from IOutputFormat, should be used in derived classes instead of out. - WriteBuffer * ostr; - -private: - /// Validates UTF-8 sequences, replaces bad sequences with replacement character. - std::unique_ptr validating_ostr; -}; - -using IOutputFormatWithUTF8Validation = IIOutputFormatWithUTF8Validation; -using IRowOutputFormatWithUTF8Validation = IIOutputFormatWithUTF8Validation; - -} -