MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / includes / desktopfilewriter.h
1 #pragma once
2
3 // system includes
4 #include <memory>
5 #include <ostream>
6
7 // local includes
8 #include "desktopfile.h"
9 #include "desktopfileentry.h"
10
11 namespace linuxdeploy {
12     namespace desktopfile {
13         class DesktopFileWriter {
14         private:
15             // opaque data class pattern
16             class PrivateData;
17             std::shared_ptr<PrivateData> d;
18
19         public:
20             // default constructor
21             DesktopFileWriter();
22
23             // construct from data
24             explicit DesktopFileWriter(DesktopFile::sections_t data);
25
26             // copy constructor
27             DesktopFileWriter(const DesktopFileWriter& other);
28
29             // copy assignment constructor
30             DesktopFileWriter& operator=(const DesktopFileWriter& other);
31
32             // move assignment operator
33             DesktopFileWriter& operator=(DesktopFileWriter&& other) noexcept;
34
35             // equality operator
36             bool operator==(const DesktopFileWriter& other) const;
37
38             // inequality operator
39             bool operator!=(const DesktopFileWriter& other) const;
40
41         public:
42             // returns desktop file path
43             DesktopFile::sections_t data() const;
44
45         public:
46             // save to given path
47             void save(const std::string& path);
48
49             // save to given ostream
50             void save(std::ostream& os);
51         };
52     }
53 }