Extracted HTTP::parseVars function from HTTP::Parser, for easier reuse.

This commit is contained in:
Thulinma 2016-08-28 13:11:55 +02:00
parent 5b2ab2453f
commit 6d33ba2cbd
2 changed files with 16 additions and 9 deletions

View file

@ -10,6 +10,12 @@
/// Holds all HTTP processing related code.
namespace HTTP {
///HTTP variable parser to std::map<std::string, std::string> structure.
///Reads variables from data, decodes and stores them to storage.
void parseVars(const std::string & data, std::map<std::string, std::string> & storage);
/// Simple class for reading and writing HTTP 1.0 and 1.1.
class Parser {
public:
@ -56,7 +62,6 @@ namespace HTTP {
bool getChunks;
unsigned int doingChunk;
bool parse(std::string & HTTPbuffer);
void parseVars(std::string data);
std::string builder;
std::string read_buffer;
std::map<std::string, std::string> headers;