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

Implement code that splits version infos.

According to the docs, the version info is
something like LALALA/X.X with X being a single digit.
This commit is contained in:
King_DuckZ 2017-04-05 09:25:25 +01:00
parent f8d6796fc1
commit 3df7a4c5d3
4 changed files with 93 additions and 13 deletions

View file

@ -5,23 +5,25 @@
#include <string>
#include <boost/utility/string_ref.hpp>
#include <cstdint>
#include <iostream>
#include <boost/optional.hpp>
namespace tawashi {
struct VersionInfo {
boost::string_ref name;
uint16_t major;
uint16_t minor;
};
class CGIEnv {
public:
struct VersionInfo {
boost::string_ref name;
uint16_t major;
uint16_t minor;
};
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;
boost::optional<VersionInfo> gateway_interface() const;
const std::string& path_info() const;
const std::string& path_translated() const;
KeyValueList query_string() const;
@ -33,9 +35,11 @@ namespace tawashi {
const std::string& script_name() const;
const std::string& server_name() const;
uint16_t server_port() const;
VersionInfo server_protocol() const;
boost::optional<VersionInfo> server_protocol() const;
const std::string& server_software() const;
std::ostream& print_all (std::ostream& parStream, const char* parNewline) const;
private:
std::vector<std::string> m_cgi_env;
};