趣味で作ってるロボット用ソフトウェア
 All Classes Files Functions Enumerations Enumerator Friends Pages
Zip.h
Go to the documentation of this file.
1 #ifndef HRK_ZIP_H
2 #define HRK_ZIP_H
3 
9 #include <memory>
10 #include <time.h>
11 #include <string>
12 #include <vector>
13 #include "Stream.h"
14 
15 
16 namespace hrk
17 {
18  class Zip : public Stream
19  {
20  public:
21  typedef struct
22  {
23  std::string name;
24  time_t date;
25  } header_t;
26  typedef std::vector<Zip::header_t> Headers;
27 
28  Zip(void);
29  ~Zip(void);
30 
31  bool is_open(void) const;
32  void close(void);
33  int write(const char* data, size_t data_size);
34  int read(char* data, size_t max_data_size, int timeout = 0);
35  bool eof(void) const;
36 
37  bool uncompress(const std::string& file_name,
38  const std::string& pass = "");
39  Zip::Headers headers(void) const;
40  bool open_read_header(const std::string& name);
41 
42  bool compress(const std::string& file_name,
43  const std::string& pass = "");
44  bool add_write_header(const std::string& name, time_t time);
45 
46 
47  private:
48  Zip(const Zip& rhs);
49  Zip& operator = (const Zip& rhs);
50 
51  struct pImpl;
52  std::auto_ptr<pImpl> pimpl;
53  };
54 }
55 
56 #endif
ストリーム操作
Definition: Zip.h:18
int read(char *data, size_t max_data_size, int timeout=0)
データの受信
Definition: Zip.cpp:1001
int write(const char *data, size_t data_size)
データの送信
Definition: Zip.cpp:992
Definition: Zip.h:21
Definition: Stream.h:14
void close(void)
接続を閉じる
Definition: Zip.cpp:985
bool is_open(void) const
受信
Definition: Zip.cpp:976