aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/streams
diff options
context:
space:
mode:
authorAlexander Fokin <apfokin@gmail.com>2022-02-10 16:45:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:38 +0300
commit863a59a65247c24db7cb06789bc5cf79d04da32f (patch)
tree139dc000c8cd4a40f5659e421b7c75135d080307 /library/cpp/streams
parentf64e95a9eb9ab03240599eb9581c5a9102426a96 (diff)
downloadydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/streams')
-rw-r--r--library/cpp/streams/bzip2/bzip2.h12
-rw-r--r--library/cpp/streams/lz/lz.cpp12
-rw-r--r--library/cpp/streams/lz/lz.h126
-rw-r--r--library/cpp/streams/lzma/lzma.cpp8
-rw-r--r--library/cpp/streams/lzma/lzma_ut.cpp18
5 files changed, 88 insertions, 88 deletions
diff --git a/library/cpp/streams/bzip2/bzip2.h b/library/cpp/streams/bzip2/bzip2.h
index 2322277ef6..9bfae08924 100644
--- a/library/cpp/streams/bzip2/bzip2.h
+++ b/library/cpp/streams/bzip2/bzip2.h
@@ -8,11 +8,11 @@
#define BZIP_BUF_LEN (8 * 1024)
#define BZIP_COMPRESSION_LEVEL 6
-/**
- * @addtogroup Streams_Archs
- * @{
- */
-
+/**
+ * @addtogroup Streams_Archs
+ * @{
+ */
+
class TBZipException: public yexception {
};
@@ -50,4 +50,4 @@ public:
THolder<TImpl> Impl_;
};
-/** @} */
+/** @} */
diff --git a/library/cpp/streams/lz/lz.cpp b/library/cpp/streams/lz/lz.cpp
index b65bb3ed96..93ef653eb9 100644
--- a/library/cpp/streams/lz/lz.cpp
+++ b/library/cpp/streams/lz/lz.cpp
@@ -37,19 +37,19 @@ public:
, BlockSize_(blockSize)
{
/*
- * save signature
- */
+ * save signature
+ */
static_assert(sizeof(TCompressor::signature) - 1 == SIGNATURE_SIZE, "expect sizeof(TCompressor::signature) - 1 == SIGNATURE_SIZE");
Slave_->Write(TCompressor::signature, sizeof(TCompressor::signature) - 1);
/*
- * save version
- */
+ * save version
+ */
this->Save((ui32)1);
/*
- * save block size
- */
+ * save block size
+ */
this->Save(BlockSize());
}
diff --git a/library/cpp/streams/lz/lz.h b/library/cpp/streams/lz/lz.h
index 3a2eaad88b..cdad6df4ed 100644
--- a/library/cpp/streams/lz/lz.h
+++ b/library/cpp/streams/lz/lz.h
@@ -5,31 +5,31 @@
#include <util/generic/ptr.h>
#include <util/generic/yexception.h>
-/**
- * @file
- *
- * All lz compressors compress blocks. `Write` method splits input data into
- * blocks, compresses each block and then writes each compressed block to the
- * underlying output stream. Thus compression classes are not buffered.
- * MaxBlockSize parameter specified max allowed block size.
- *
- * See http://altdevblogaday.com/2011/04/22/survey-of-fast-compression-algorithms-part-1/
- * for some comparisons.
- */
+/**
+ * @file
+ *
+ * All lz compressors compress blocks. `Write` method splits input data into
+ * blocks, compresses each block and then writes each compressed block to the
+ * underlying output stream. Thus compression classes are not buffered.
+ * MaxBlockSize parameter specified max allowed block size.
+ *
+ * See http://altdevblogaday.com/2011/04/22/survey-of-fast-compression-algorithms-part-1/
+ * for some comparisons.
+ */
struct TDecompressorError: public yexception {
};
-/**
- * @addtogroup Streams_Archs
- * @{
- */
-
-/**
- * Lz4 compressing stream.
- *
- * @see http://code.google.com/p/lz4/
+/**
+ * @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);
@@ -45,11 +45,11 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * Lz4 decompressing stream.
- *
- * @see http://code.google.com/p/lz4/
- */
+/**
+ * Lz4 decompressing stream.
+ *
+ * @see http://code.google.com/p/lz4/
+ */
class TLz4Decompress: public IInputStream {
public:
TLz4Decompress(IInputStream* slave);
@@ -63,10 +63,10 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * Snappy compressing stream.
- *
- * @see http://code.google.com/p/snappy/
+/**
+ * Snappy compressing stream.
+ *
+ * @see http://code.google.com/p/snappy/
*/
class TSnappyCompress: public IOutputStream {
public:
@@ -83,11 +83,11 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * Snappy decompressing stream.
- *
- * @see http://code.google.com/p/snappy/
- */
+/**
+ * Snappy decompressing stream.
+ *
+ * @see http://code.google.com/p/snappy/
+ */
class TSnappyDecompress: public IInputStream {
public:
TSnappyDecompress(IInputStream* slave);
@@ -101,8 +101,8 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * MiniLZO compressing stream.
+/**
+ * MiniLZO compressing stream.
*/
class TLzoCompress: public IOutputStream {
public:
@@ -119,9 +119,9 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * MiniLZO decompressing stream.
- */
+/**
+ * MiniLZO decompressing stream.
+ */
class TLzoDecompress: public IInputStream {
public:
TLzoDecompress(IInputStream* slave);
@@ -135,8 +135,8 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * FastLZ compressing stream.
+/**
+ * FastLZ compressing stream.
*/
class TLzfCompress: public IOutputStream {
public:
@@ -153,9 +153,9 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * FastLZ decompressing stream.
- */
+/**
+ * FastLZ decompressing stream.
+ */
class TLzfDecompress: public IInputStream {
public:
TLzfDecompress(IInputStream* slave);
@@ -169,8 +169,8 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * QuickLZ compressing stream.
+/**
+ * QuickLZ compressing stream.
*/
class TLzqCompress: public IOutputStream {
public:
@@ -181,8 +181,8 @@ public:
};
/*
- * streaming mode - actually, backlog size
- */
+ * streaming mode - actually, backlog size
+ */
enum EMode {
M_0 = 0,
M_100000 = 1,
@@ -205,9 +205,9 @@ private:
THolder<TImpl> Impl_;
};
-/**
- * QuickLZ decompressing stream.
- */
+/**
+ * QuickLZ decompressing stream.
+ */
class TLzqDecompress: public IInputStream {
public:
TLzqDecompress(IInputStream* slave);
@@ -221,18 +221,18 @@ private:
THolder<TImpl> Impl_;
};
-/** @} */
-
-/**
- * Reads a compression signature from the provided input stream and returns a
- * corresponding decompressing stream.
- *
- * Note that returned stream doesn't own the provided input stream, thus it's
- * up to the user to free them both.
- *
- * @param input Stream to decompress.
- * @return Decompressing proxy input stream.
- */
+/** @} */
+
+/**
+ * Reads a compression signature from the provided input stream and returns a
+ * corresponding decompressing stream.
+ *
+ * Note that returned stream doesn't own the provided input stream, thus it's
+ * up to the user to free them both.
+ *
+ * @param input Stream to decompress.
+ * @return Decompressing proxy input stream.
+ */
TAutoPtr<IInputStream> OpenLzDecompressor(IInputStream* input);
TAutoPtr<IInputStream> TryOpenLzDecompressor(IInputStream* input);
TAutoPtr<IInputStream> TryOpenLzDecompressor(const TStringBuf& signature, IInputStream* input);
diff --git a/library/cpp/streams/lzma/lzma.cpp b/library/cpp/streams/lzma/lzma.cpp
index f1942fa546..e0d3e896fd 100644
--- a/library/cpp/streams/lzma/lzma.cpp
+++ b/library/cpp/streams/lzma/lzma.cpp
@@ -179,7 +179,7 @@ namespace {
inline bool FlushImpl() {
if (Out_.Avail()) {
- TransferData(&Out_, Slave_);
+ TransferData(&Out_, Slave_);
Out_.Reset(nullptr, 0);
return true;
@@ -464,12 +464,12 @@ public:
private:
bool Fill() override {
- size_t size = Input_->Next(&InBegin_);
+ size_t size = Input_->Next(&InBegin_);
- if (size) {
+ if (size) {
InEnd_ = InBegin_ + size;
- return true;
+ return true;
}
return false;
diff --git a/library/cpp/streams/lzma/lzma_ut.cpp b/library/cpp/streams/lzma/lzma_ut.cpp
index 847e98d1ca..f73d8509b6 100644
--- a/library/cpp/streams/lzma/lzma_ut.cpp
+++ b/library/cpp/streams/lzma/lzma_ut.cpp
@@ -17,12 +17,12 @@ public:
private:
size_t DoNext(const void** ptr, size_t len) override {
if (Pos < Data.end()) {
- len = Min(len, static_cast<size_t>(1));
- *ptr = Pos;
- Pos += len;
- return len;
+ len = Min(len, static_cast<size_t>(1));
+ *ptr = Pos;
+ Pos += len;
+ return len;
} else {
- return 0;
+ return 0;
}
}
@@ -69,7 +69,7 @@ private:
try {
TLzmaCompress c(&out);
- TransferData(&mi, &c);
+ TransferData(&mi, &c);
} catch (int i) {
UNIT_ASSERT_EQUAL(i, 12345);
}
@@ -85,7 +85,7 @@ private:
TStringOutput so(res);
TLzmaCompress c(&so);
- TransferData(&mi, &c);
+ TransferData(&mi, &c);
c.Finish();
}
@@ -104,7 +104,7 @@ private:
{
TMemoryInput mi(res.data(), res.size());
TStringOutput so(data1);
- TLzmaDecompress d(&mi);
+ TLzmaDecompress d(&mi);
TransferData(&d, &so);
}
@@ -115,7 +115,7 @@ private:
{
TStrokaByOneByte mi(res);
TStringOutput so(data1);
- TLzmaDecompress d(&mi);
+ TLzmaDecompress d(&mi);
TransferData(&d, &so);
}