1 | #include "path.hpp" |
2 | |
3 | #include <sys/stat.h> |
4 | |
5 | bool Path::do_start() |
6 | { |
7 | if (mkdir(pathname: path.c_str(), mode: 0755) != 0) |
8 | return false; |
9 | return true; |
10 | } |
11 | |
12 | bool Path::do_stop() |
13 | { |
14 | std::cout << "stopping path " << id << std::endl; |
15 | return true; |
16 | } |
17 | |
18 | bool Path::do_load(const toml::table &data) |
19 | { |
20 | this->path = data["path" ].value_or(default_value: "unknown" ); |
21 | return true; |
22 | } |
23 | |
24 | void Path::do_print(std::ostream &os) const |
25 | { |
26 | os << " path: " << this->path << std::endl; |
27 | } |
28 | |