blob: 3ac00d96e5c8225f69900871a22e657728c7ba4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  | 
#pragma once
#include <cstdio>
#include <string>
#include <vector>
class CGIScript {
public:
	CGIScript(const std::string& script_path);
	~CGIScript();
	void set_environment(const char* key, const char* value);
	bool open();
	std::string read_output();
	static void validate_path(const std::string& path);
private:
	FILE* m_pipe {};
	const std::string& m_script_path;
	bool m_is_open { false };
	std::vector<const char*> m_environment_variables;
};
 
  |