MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / includes / subprocess.h
1 #pragma once
2
3 // system headers
4 #include <cstdio>
5 #include <unordered_map>
6 #include <string>
7 #include <utility>
8 #include <vector>
9
10 // local headers
11 #include "subprocess_result.h"
12
13 namespace linuxdeploy {
14     namespace subprocess {
15         typedef std::unordered_map<std::string, std::string> subprocess_env_map_t;
16
17         class subprocess {
18         private:
19             std::vector<std::string> args_{};
20             std::unordered_map<std::string, std::string> env_{};
21
22         public:
23             subprocess(std::initializer_list<std::string> args, subprocess_env_map_t env = {});
24
25             explicit subprocess(std::vector<std::string> args, subprocess_env_map_t env = {});
26
27             subprocess_result run() const;
28
29             std::string check_output() const;
30         };
31     }
32 }