aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/streams/lz/lz.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/streams/lz/lz.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/streams/lz/lz.h')
-rw-r--r--library/cpp/streams/lz/lz.h196
1 files changed, 98 insertions, 98 deletions
diff --git a/library/cpp/streams/lz/lz.h b/library/cpp/streams/lz/lz.h
index 3a2eaad88b..95120fffed 100644
--- a/library/cpp/streams/lz/lz.h
+++ b/library/cpp/streams/lz/lz.h
@@ -1,7 +1,7 @@
#pragma once
-
-#include <util/stream/output.h>
-#include <util/stream/input.h>
+
+#include <util/stream/output.h>
+#include <util/stream/input.h>
#include <util/generic/ptr.h>
#include <util/generic/yexception.h>
@@ -17,7 +17,7 @@
* for some comparisons.
*/
-struct TDecompressorError: public yexception {
+struct TDecompressorError: public yexception {
};
/**
@@ -31,18 +31,18 @@ struct TDecompressorError: public yexception {
* @see http://code.google.com/p/lz4/
*/
class TLz4Compress: public IOutputStream {
-public:
+public:
TLz4Compress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15);
~TLz4Compress() override;
-private:
+private:
void DoWrite(const void* buf, size_t len) override;
void DoFlush() override;
void DoFinish() override;
-private:
- class TImpl;
- THolder<TImpl> Impl_;
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
};
/**
@@ -51,16 +51,16 @@ private:
* @see http://code.google.com/p/lz4/
*/
class TLz4Decompress: public IInputStream {
-public:
+public:
TLz4Decompress(IInputStream* slave);
~TLz4Decompress() override;
-private:
+private:
size_t DoRead(void* buf, size_t len) override;
-private:
- class TImpl;
- THolder<TImpl> Impl_;
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
};
/**
@@ -69,18 +69,18 @@ private:
* @see http://code.google.com/p/snappy/
*/
class TSnappyCompress: public IOutputStream {
-public:
+public:
TSnappyCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15);
~TSnappyCompress() override;
-private:
+private:
void DoWrite(const void* buf, size_t len) override;
void DoFlush() override;
void DoFinish() override;
-private:
- class TImpl;
- THolder<TImpl> Impl_;
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
};
/**
@@ -89,138 +89,138 @@ private:
* @see http://code.google.com/p/snappy/
*/
class TSnappyDecompress: public IInputStream {
-public:
+public:
TSnappyDecompress(IInputStream* slave);
~TSnappyDecompress() override;
-private:
+private:
size_t DoRead(void* buf, size_t len) override;
-private:
- class TImpl;
- THolder<TImpl> Impl_;
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
};
/**
* MiniLZO compressing stream.
- */
+ */
class TLzoCompress: public IOutputStream {
-public:
+public:
TLzoCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15);
~TLzoCompress() override;
-
-private:
+
+private:
void DoWrite(const void* buf, size_t len) override;
void DoFlush() override;
void DoFinish() override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/**
* MiniLZO decompressing stream.
*/
class TLzoDecompress: public IInputStream {
-public:
+public:
TLzoDecompress(IInputStream* slave);
~TLzoDecompress() override;
-
-private:
+
+private:
size_t DoRead(void* buf, size_t len) override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/**
* FastLZ compressing stream.
- */
+ */
class TLzfCompress: public IOutputStream {
-public:
+public:
TLzfCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15);
~TLzfCompress() override;
-
-private:
+
+private:
void DoWrite(const void* buf, size_t len) override;
void DoFlush() override;
void DoFinish() override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/**
* FastLZ decompressing stream.
*/
class TLzfDecompress: public IInputStream {
-public:
+public:
TLzfDecompress(IInputStream* slave);
~TLzfDecompress() override;
-
-private:
+
+private:
size_t DoRead(void* buf, size_t len) override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/**
* QuickLZ compressing stream.
- */
+ */
class TLzqCompress: public IOutputStream {
-public:
- enum EVersion {
- V_1_31 = 0,
- V_1_40 = 1,
- V_1_51 = 2
- };
-
- /*
+public:
+ enum EVersion {
+ V_1_31 = 0,
+ V_1_40 = 1,
+ V_1_51 = 2
+ };
+
+ /*
* streaming mode - actually, backlog size
*/
- enum EMode {
- M_0 = 0,
- M_100000 = 1,
- M_1000000 = 2
- };
-
+ enum EMode {
+ M_0 = 0,
+ M_100000 = 1,
+ M_1000000 = 2
+ };
+
TLzqCompress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15,
- EVersion ver = V_1_31,
- unsigned level = 0,
- EMode mode = M_0);
+ EVersion ver = V_1_31,
+ unsigned level = 0,
+ EMode mode = M_0);
~TLzqCompress() override;
-
-private:
+
+private:
void DoWrite(const void* buf, size_t len) override;
void DoFlush() override;
void DoFinish() override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/**
* QuickLZ decompressing stream.
*/
class TLzqDecompress: public IInputStream {
-public:
+public:
TLzqDecompress(IInputStream* slave);
~TLzqDecompress() override;
-
-private:
+
+private:
size_t DoRead(void* buf, size_t len) override;
-
-private:
- class TImpl;
- THolder<TImpl> Impl_;
-};
-
+
+private:
+ class TImpl;
+ THolder<TImpl> Impl_;
+};
+
/** @} */
/**
@@ -236,7 +236,7 @@ private:
TAutoPtr<IInputStream> OpenLzDecompressor(IInputStream* input);
TAutoPtr<IInputStream> TryOpenLzDecompressor(IInputStream* input);
TAutoPtr<IInputStream> TryOpenLzDecompressor(const TStringBuf& signature, IInputStream* input);
-
+
TAutoPtr<IInputStream> OpenOwnedLzDecompressor(TAutoPtr<IInputStream> input);
TAutoPtr<IInputStream> TryOpenOwnedLzDecompressor(TAutoPtr<IInputStream> input);
TAutoPtr<IInputStream> TryOpenOwnedLzDecompressor(const TStringBuf& signature, TAutoPtr<IInputStream> input);