MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / Ex

Class Ex

test/test_main.cc:7–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5struct executable { std::string exe_; };
6
7class Ex {
8public:
9 template <typename... Args>
10 Ex(Args&&... args) {
11 set_options(std::forward<Args>(args)...);
12 }
13
14 template <typename T>
15 void set_options(T&& arg) {
16 set_option(std::forward<T>(arg));
17 }
18
19 template <typename T, typename... Args>
20 void set_options(T&& first, Args&&... rem_args) {
21 set_option(std::forward<T>(first));
22 set_options(std::forward<Args>(rem_args)...);
23 }
24
25 void set_option(bufsize&& bufs) {
26 std::cout << "bufsize opt" << std::endl;
27 bufsiz_ = bufs.siz_;
28 }
29 void set_option(executable&& exe) {
30 std::cout << "exe opt" << std::endl;
31 exe_name_ = std::move(exe.exe_);
32 }
33
34private:
35 int bufsiz_ = 0;
36 std::string exe_name_;
37};
38
39int main() {
40 Ex e(bufsize{1}, executable{"finger"});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected