ultimatepp/uppsrc/Core/z.h
cxl b0cc9c51af OutStream, TeeStream, Md5Stream, Sha1Stream, Crc32Stream, MD5, SHA1, CRC32, optimized C++ parser, CodeEditor annotations
git-svn-id: svn://ultimatepp.org/upp/trunk@487 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-09-28 18:15:28 +00:00

35 lines
1.5 KiB
C++

class Crc32Stream : public OutStream {
dword crc;
virtual void Out(const void *data, dword size);
public:
dword Finish() { Flush(); return crc; }
operator dword() { return Finish(); }
Crc32Stream();
};
dword CRC32(const void *ptr, dword count);
dword CRC32(const String& s);
int ZCompress(Stream& out, Stream& in, int size, Gate2<int, int> progress = false, bool nohdr = false, dword *crc = NULL);
int ZDecompress(Stream& out, Stream& in, int size, Gate2<int, int> progress = false, bool nohdr = false, dword *crc = NULL);
int ZCompress(Stream& out, Stream& in, Gate2<int, int> progress = false);
int ZDecompress(Stream& out, Stream& in, Gate2<int, int> progress = false);
String ZCompress(const void *data, int len, Gate2<int, int> progress = false);
String ZDecompress(const void *data, int len, Gate2<int, int> progress = false);
String ZCompress(const String& s, Gate2<int, int> progress = false);
String ZDecompress(const String& s, Gate2<int, int> progress = false);
int GZCompress(Stream& out, Stream& in, int size, Gate2<int, int> progress = false);
int GZDecompress(Stream& out, Stream& in, int size, Gate2<int, int> progress = false);
String GZCompress(const void *data, int len, Gate2<int, int> progress = false);
String GZDecompress(const void *data, int len, Gate2<int, int> progress = false);
String GZCompress(const String& s, Gate2<int, int> progress = false);
String GZDecompress(const String& s, Gate2<int, int> progress = false);