diff options
author | cflip <cflip@cflip.net> | 2022-09-19 13:47:51 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-19 13:48:33 -0600 |
commit | 2ef8197a75c3d7605279b6c41c2eb3e1643d5374 (patch) | |
tree | aebda710c6ac59132d47554fc5420e2ac6cc16d3 /src/CGIScript.h | |
parent | 91c237df6a65f6ec446eea4b89216ad53c9f7e0e (diff) |
Refactor the CGIScript class a bit
This allows the user of the class to set environment variables before
opening the pipe to the script.
Diffstat (limited to 'src/CGIScript.h')
-rw-r--r-- | src/CGIScript.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/CGIScript.h b/src/CGIScript.h index a64c55a..622206d 100644 --- a/src/CGIScript.h +++ b/src/CGIScript.h @@ -4,19 +4,18 @@ #include <string> #include <vector> -#include "HttpRequest.h" - class CGIScript { public: - CGIScript(const std::string& path, const HttpRequest&); + CGIScript(const std::string& script_path); ~CGIScript(); void set_environment(const char* key, const char* value); - bool is_open() const { return m_is_open; } + bool open(); std::string read_output(); private: FILE* m_pipe; + const std::string& m_script_path; bool m_is_open{false}; std::vector<const char*> m_environment_variables; |