retdec
compressed_data.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_UNPACKER_DECOMPRESSION_COMPRESSED_DATA_H
8 #define RETDEC_UNPACKER_DECOMPRESSION_COMPRESSED_DATA_H
9 
10 #include <cstdint>
11 #include <vector>
12 
14 
15 using namespace retdec::utils;
16 
17 namespace retdec {
18 namespace unpacker {
19 
26 {
27 public:
28  CompressedData() = delete;
29  CompressedData(const DynamicBuffer& buffer) : _buffer(buffer) {}
30  CompressedData(const CompressedData& data) : _buffer(data._buffer) {}
31  virtual ~CompressedData() = default;
32 
38  const DynamicBuffer& getBuffer() const { return _buffer; }
39 
45  void setBuffer(const DynamicBuffer& buffer) { _buffer = buffer; }
46 
54  virtual bool decompress(DynamicBuffer& outputBuffer) = 0;
55 
56 protected:
58 
59 private:
60  CompressedData& operator =(const CompressedData&);
61 };
62 
63 } // namespace unpacker
64 } // namespace retdec
65 
66 #endif
Abstract class for compressed data.
Definition: compressed_data.h:26
virtual bool decompress(DynamicBuffer &outputBuffer)=0
CompressedData(const CompressedData &data)
Copy constructor.
Definition: compressed_data.h:30
const DynamicBuffer & getBuffer() const
Definition: compressed_data.h:38
virtual ~CompressedData()=default
DynamicBuffer _buffer
Buffer containg the compressed data.
Definition: compressed_data.h:57
CompressedData(const DynamicBuffer &buffer)
Constructor.
Definition: compressed_data.h:29
void setBuffer(const DynamicBuffer &buffer)
Definition: compressed_data.h:45
The class for dynamic buffered data manipulation taking the endianness of the data in account.
Definition: dynamic_buffer.h:36
Declaration of class for buffered data mainpulation.
Definition: unpacking_stub.h:16
Definition: archive_wrapper.h:19
Supportive functionality for the generic unpacker.