diff options
author | cflip <cflip@cflip.net> | 2022-09-17 11:47:23 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-17 11:47:23 -0600 |
commit | e3aa12a8cfa137f65c5ca06489e1f58f0608db54 (patch) | |
tree | 7fbc3dafa53808747b7a6b0da90227bff43dc834 /src/CGIScript.h | |
parent | a4140573844a83eda92367ae1e7d557b0033fb4d (diff) |
Make a nice wrapper class for running CGI scripts
Diffstat (limited to 'src/CGIScript.h')
-rw-r--r-- | src/CGIScript.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/CGIScript.h b/src/CGIScript.h new file mode 100644 index 0000000..6e8e031 --- /dev/null +++ b/src/CGIScript.h @@ -0,0 +1,19 @@ +#pragma once + +#include <cstdio> +#include <string> + +#include "HttpRequest.h" + +class CGIScript { +public: + CGIScript(const std::string& path, const HttpRequest&); + ~CGIScript(); + + bool is_open() const { return m_is_open; } + + std::string read_output(); +private: + FILE* m_pipe; + bool m_is_open{false}; +}; |