From e3aa12a8cfa137f65c5ca06489e1f58f0608db54 Mon Sep 17 00:00:00 2001 From: cflip Date: Sat, 17 Sep 2022 11:47:23 -0600 Subject: Make a nice wrapper class for running CGI scripts --- src/CGIScript.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/CGIScript.h (limited to 'src/CGIScript.h') 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 +#include + +#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}; +}; -- cgit v1.2.3