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

Add CurlWrapper class and use it to escape GET/POST values.

Use the new code to print the values from the request.
This commit is contained in:
King_DuckZ 2017-04-06 20:15:44 +01:00
parent 6a502df135
commit cc20a8ccfb
10 changed files with 143 additions and 17 deletions

View file

@ -2,12 +2,14 @@
#include "split_get_vars.hpp"
#include "duckhandy/compatibility.h"
#include "curl_wrapper.hpp"
#include <vector>
#include <string>
#include <boost/utility/string_ref.hpp>
#include <cstdint>
#include <iostream>
#include <boost/optional.hpp>
#include <boost/container/flat_map.hpp>
namespace tawashi {
class CGIEnv {
@ -18,6 +20,8 @@ namespace tawashi {
uint16_t minor;
};
typedef boost::container::flat_map<std::string, std::string> GetMapType;
CGIEnv();
~CGIEnv() noexcept;
@ -39,11 +43,12 @@ namespace tawashi {
boost::optional<VersionInfo> server_protocol() const a_pure;
const std::string& server_software() const;
KeyValueList query_string_split() const a_pure;
GetMapType query_string_split() const a_pure;
std::ostream& print_all (std::ostream& parStream, const char* parNewline) const;
private:
std::vector<std::string> m_cgi_env;
CurlWrapper m_curl;
};
} //namespace tawashi