81
|
1 #pragma once
|
|
2
|
|
3 #include <stdint.h>
|
|
4 #include <string.h>
|
|
5 #include <boost/shared_ptr.hpp>
|
|
6
|
|
7 namespace Orthanc
|
|
8 {
|
|
9 class ZipWriter
|
|
10 {
|
|
11 private:
|
|
12 struct PImpl;
|
|
13 boost::shared_ptr<PImpl> pimpl_;
|
|
14
|
|
15 bool hasFileInZip_;
|
|
16 uint8_t compressionLevel_;
|
|
17 std::string path_;
|
|
18
|
|
19 public:
|
|
20 ZipWriter();
|
|
21
|
|
22 ~ZipWriter();
|
|
23
|
|
24 void SetCompressionLevel(uint8_t level);
|
|
25
|
|
26 uint8_t GetCompressionLevel() const
|
|
27 {
|
|
28 return compressionLevel_;
|
|
29 }
|
|
30
|
|
31 void Open();
|
|
32
|
|
33 void Close();
|
|
34
|
|
35 bool IsOpen() const;
|
|
36
|
|
37 void SetOutputPath(const char* path);
|
|
38
|
|
39 const std::string& GetOutputPath() const
|
|
40 {
|
|
41 return path_;
|
|
42 }
|
|
43
|
|
44 void CreateFileInZip(const char* path);
|
|
45
|
|
46 void Write(const char* data, size_t length);
|
|
47
|
|
48 void Write(const std::string& data);
|
|
49 };
|
|
50 }
|