karazeh
A cross-platform software updating library.
file_manager.hpp
Go to the documentation of this file.
1 
21 #ifndef H_KARAZEH_FILE_MANAGER_H
22 #define H_KARAZEH_FILE_MANAGER_H
23 
24 #include <curl/curl.h>
25 #include <boost/filesystem.hpp>
26 #include "binreloc/binreloc.h"
27 #include "karazeh_export.h"
28 #include "karazeh/karazeh.hpp"
29 #include "karazeh/logger.hpp"
30 #include "karazeh/hasher.hpp"
31 
32 namespace kzh {
34  public:
35 
36  file_manager();
37  virtual ~file_manager();
38 
40  virtual bool load_file(std::ifstream &fs, string_t& out_buf) const;
41 
43  virtual bool load_file(string_t const& path, string_t& out_buf) const;
44  virtual bool load_file(path_t const& path, string_t& out_buf) const;
45 
46  virtual bool remove_file(path_t const&) const;
47  virtual bool remove_directory(path_t const&) const;
48 
49  virtual bool exists(path_t const&) const;
50 
51  virtual bool is_empty(path_t const&) const;
52  virtual bool is_directory(path_t const&) const;
53 
55  virtual bool is_readable(path_t const &path) const;
56  virtual bool is_readable(string_t const &path) const;
57 
59  virtual bool is_writable(path_t const &path) const;
60  virtual bool is_writable(string_t const &path) const;
61 
62  virtual bool move(path_t const&, path_t const&) const;
63 
71  virtual bool create_directory(path_t const& path) const;
72  virtual bool ensure_directory(path_t const& path) const;
73 
81  virtual bool make_executable(path_t const&) const;
82 
83  virtual uint64_t stat_filesize(path_t const&) const;
84  virtual uint64_t stat_filesize(std::ifstream&) const;
85  };
86 
87 } // end of namespace kzh
88 
89 #endif
boost::filesystem::path path_t
Definition: karazeh.hpp:57
std::string string_t
Definition: karazeh.hpp:55
Definition: config.hpp:32
unsigned long uint64_t
Definition: karazeh.hpp:56
Definition: logger.hpp:35
Definition: config.hpp:27
kzh::file_manager const * file_manager
Definition: config.hpp:38
Definition: file_manager.hpp:33