1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2025-08-07 12:59:45 +00:00

Wrap environment in a class.

This commit is contained in:
King_DuckZ 2017-04-05 08:41:49 +01:00
parent fea5b738df
commit f8d6796fc1
6 changed files with 137 additions and 17 deletions

42
src/cgi_env.hpp Normal file
View file

@ -0,0 +1,42 @@
#pragma once
#include "split_get_vars.hpp"
#include <vector>
#include <string>
#include <boost/utility/string_ref.hpp>
#include <cstdint>
namespace tawashi {
struct VersionInfo {
boost::string_ref name;
uint16_t major;
uint16_t minor;
};
class CGIEnv {
public:
CGIEnv();
~CGIEnv() noexcept;
const std::string& auth_type() const;
std::size_t content_length() const;
const std::string& content_type() const;
VersionInfo gateway_interface() const;
const std::string& path_info() const;
const std::string& path_translated() const;
KeyValueList query_string() const;
const std::string& remote_addr() const;
const std::string& remote_host() const;
const std::string& remote_ident() const;
const std::string& remote_user() const;
const std::string& request_method() const;
const std::string& script_name() const;
const std::string& server_name() const;
uint16_t server_port() const;
VersionInfo server_protocol() const;
const std::string& server_software() const;
private:
std::vector<std::string> m_cgi_env;
};
} //namespace tawashi