gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
camera_file_wrapper.hpp
Go to the documentation of this file.
1 
25 #ifndef CAMERAFILEWRAPPER_HPP
26 #define CAMERAFILEWRAPPER_HPP
27 
28 #include <string>
29 #include <ctime>
30 #include <vector>
31 
32 namespace gphoto2
33 {
34  struct _CameraFile;
35 }
36 
37 namespace gphoto2pp
38 {
39  //Forward Declarations
40  enum class CameraFileTypeWrapper : int;
41 
47  {
48  public:
51 
52  // Move constructor and move assignment
54  CameraFileWrapper& operator=(CameraFileWrapper&& other);
55 
56  // Copy constructor and copy assignment
60  CameraFileWrapper(CameraFileWrapper const & other);
61 
65  CameraFileWrapper& operator=( CameraFileWrapper const & other );
66 
67  gphoto2::_CameraFile* getPtr() const;
68 
76  std::vector<char> getDataAndSize() const;
77 
84  void setDataAndSize(std::vector<char> const & file);
85 
92  std::string getMimeType() const;
93 
100  void setMimeType(std::string const & mimeType);
101 
108  std::string getFileName() const;
109 
116  void setFileName(std::string const & fileName);
117 
124  void detectMimeType() const;
125 
144  void adjustNameForMimeType();
145 
151  std::time_t getMtime() const;
152 
159  void setMtime(std::time_t mtime);
160 
168  std::string getNameByType(std::string const & baseName, CameraFileTypeWrapper const & type) const; // This command is only supported by GPhoto >= 2.5
169 
176  void save(std::string const & filename) const;
177 
178  private:
179  gphoto2::_CameraFile* m_cameraFile;
180 
181  };
182 
183 }
184 
185 #endif // CAMERAFILEWRAPPER_HPP