diff options
author | prime <prime@yandex-team.com> | 2022-08-29 17:04:03 +0300 |
---|---|---|
committer | prime <prime@yandex-team.com> | 2022-08-29 17:04:03 +0300 |
commit | 44b551befb68eebdae64f7581e211e9e8360474d (patch) | |
tree | b315c77d84c4aa534e4e0126d354ccc8faa0c292 | |
parent | 5fd371abc806e687416ef7d93138c414001f1f85 (diff) | |
download | ydb-44b551befb68eebdae64f7581e211e9e8360474d.tar.gz |
Split library/cpp/streams/lz into separate codecs
-rw-r--r-- | contrib/restricted/boost/test/include/boost/test/tools/old/impl.hpp | 3 | ||||
-rw-r--r-- | library/cpp/streams/lz/common/error.h | 6 | ||||
-rw-r--r-- | library/cpp/streams/lz/lz.h | 84 | ||||
-rw-r--r-- | library/cpp/streams/lz/lz4/lz4.h | 50 | ||||
-rw-r--r-- | library/cpp/streams/lz/snappy/snappy.h | 50 |
5 files changed, 111 insertions, 82 deletions
diff --git a/contrib/restricted/boost/test/include/boost/test/tools/old/impl.hpp b/contrib/restricted/boost/test/include/boost/test/tools/old/impl.hpp index 1e463f3004..ae583a1880 100644 --- a/contrib/restricted/boost/test/include/boost/test/tools/old/impl.hpp +++ b/contrib/restricted/boost/test/include/boost/test/tools/old/impl.hpp @@ -161,8 +161,6 @@ struct ne_impl { //____________________________________________________________________________// -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" struct lt_impl { template <class Left, class Right> assertion_result operator()( Left const& left, Right const& right ) @@ -200,7 +198,6 @@ struct ge_impl { return left >= right; } }; -#pragma GCC diagnostic pop //____________________________________________________________________________// diff --git a/library/cpp/streams/lz/common/error.h b/library/cpp/streams/lz/common/error.h new file mode 100644 index 0000000000..371945d5b4 --- /dev/null +++ b/library/cpp/streams/lz/common/error.h @@ -0,0 +1,6 @@ +#pragma once + +#include <util/generic/yexception.h> + +struct TDecompressorError: public yexception { +}; diff --git a/library/cpp/streams/lz/lz.h b/library/cpp/streams/lz/lz.h index 3a2eaad88b..2124d8b4bc 100644 --- a/library/cpp/streams/lz/lz.h +++ b/library/cpp/streams/lz/lz.h @@ -5,6 +5,11 @@ #include <util/generic/ptr.h> #include <util/generic/yexception.h> +#include <library/cpp/streams/lz/common/error.h> + +#include <library/cpp/streams/lz/lz4/lz4.h> +#include <library/cpp/streams/lz/snappy/snappy.h> + /** * @file * @@ -17,91 +22,12 @@ * for some comparisons. */ -struct TDecompressorError: public yexception { -}; - /** * @addtogroup Streams_Archs * @{ */ /** - * Lz4 compressing stream. - * - * @see http://code.google.com/p/lz4/ - */ -class TLz4Compress: public IOutputStream { -public: - TLz4Compress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15); - ~TLz4Compress() override; - -private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; - -private: - class TImpl; - THolder<TImpl> Impl_; -}; - -/** - * Lz4 decompressing stream. - * - * @see http://code.google.com/p/lz4/ - */ -class TLz4Decompress: public IInputStream { -public: - TLz4Decompress(IInputStream* slave); - ~TLz4Decompress() override; - -private: - size_t DoRead(void* buf, size_t len) override; - -private: - class TImpl; - THolder<TImpl> Impl_; -}; - -/** - * Snappy compressing stream. - * - * @see http://code.google.com/p/snappy/ - */ -class TSnappyCompress: public IOutputStream { -public: - TSnappyCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15); - ~TSnappyCompress() override; - -private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; - -private: - class TImpl; - THolder<TImpl> Impl_; -}; - -/** - * Snappy decompressing stream. - * - * @see http://code.google.com/p/snappy/ - */ -class TSnappyDecompress: public IInputStream { -public: - TSnappyDecompress(IInputStream* slave); - ~TSnappyDecompress() override; - -private: - size_t DoRead(void* buf, size_t len) override; - -private: - class TImpl; - THolder<TImpl> Impl_; -}; - -/** * MiniLZO compressing stream. */ class TLzoCompress: public IOutputStream { diff --git a/library/cpp/streams/lz/lz4/lz4.h b/library/cpp/streams/lz/lz4/lz4.h new file mode 100644 index 0000000000..24d66c8071 --- /dev/null +++ b/library/cpp/streams/lz/lz4/lz4.h @@ -0,0 +1,50 @@ +#pragma once + +#include <util/stream/output.h> +#include <util/stream/input.h> +#include <util/generic/ptr.h> + +/** + * @addtogroup Streams_Archs + * @{ + */ + +/** + * Lz4 compressing stream. + * + * @see http://code.google.com/p/lz4/ + */ +class TLz4Compress: public IOutputStream { +public: + TLz4Compress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15); + ~TLz4Compress() override; + +private: + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; + +private: + class TImpl; + THolder<TImpl> Impl_; +}; + +/** + * Lz4 decompressing stream. + * + * @see http://code.google.com/p/lz4/ + */ +class TLz4Decompress: public IInputStream { +public: + TLz4Decompress(IInputStream* slave); + ~TLz4Decompress() override; + +private: + size_t DoRead(void* buf, size_t len) override; + +private: + class TImpl; + THolder<TImpl> Impl_; +}; + +/** @} */ diff --git a/library/cpp/streams/lz/snappy/snappy.h b/library/cpp/streams/lz/snappy/snappy.h new file mode 100644 index 0000000000..2e680217aa --- /dev/null +++ b/library/cpp/streams/lz/snappy/snappy.h @@ -0,0 +1,50 @@ +#pragma once + +#include <util/stream/output.h> +#include <util/stream/input.h> +#include <util/generic/ptr.h> + +/** + * @addtogroup Streams_Archs + * @{ + */ + +/** + * Snappy compressing stream. + * + * @see http://code.google.com/p/snappy/ + */ +class TSnappyCompress: public IOutputStream { +public: + TSnappyCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15); + ~TSnappyCompress() override; + +private: + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; + +private: + class TImpl; + THolder<TImpl> Impl_; +}; + +/** + * Snappy decompressing stream. + * + * @see http://code.google.com/p/snappy/ + */ +class TSnappyDecompress: public IInputStream { +public: + TSnappyDecompress(IInputStream* slave); + ~TSnappyDecompress() override; + +private: + size_t DoRead(void* buf, size_t len) override; + +private: + class TImpl; + THolder<TImpl> Impl_; +}; + +/** @} */ |