klee
CompressionStream.h
Go to the documentation of this file.
1//===-- CompressionStream.h --------------------------------------------===//
2//
3// The KLEE Symbolic Virtual Machine
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef KLEE_COMPRESSIONSTREAM_H
11#define KLEE_COMPRESSIONSTREAM_H
12
13#include "llvm/Support/raw_ostream.h"
14#include "zlib.h"
15
16namespace klee {
17const size_t BUFSIZE = 128 * 1024;
18
19class compressed_fd_ostream : public llvm::raw_ostream {
20 int FD;
21 uint8_t buffer[BUFSIZE];
22 z_stream strm;
23 uint64_t pos;
24
26 virtual void write_impl(const char *Ptr, size_t Size);
27 void write_file(const char *Ptr, size_t Size);
28
29 virtual uint64_t current_pos() const { return pos; }
30
33
34public:
40 compressed_fd_ostream(const std::string &Filename, std::string &ErrorInfo);
41
43};
44}
45
46#endif /* KLEE_COMPRESSIONSTREAM_H */
void write_file(const char *Ptr, size_t Size)
virtual uint64_t current_pos() const
compressed_fd_ostream(const std::string &Filename, std::string &ErrorInfo)
virtual void write_impl(const char *Ptr, size_t Size)
write_impl - See raw_ostream::write_impl.
Definition: main.cpp:291
const size_t BUFSIZE