Added generic URL parsing class

This commit is contained in:
Thulinma 2016-09-16 18:24:48 +02:00
parent 6d33ba2cbd
commit e57cf42352
2 changed files with 87 additions and 1 deletions

View file

@ -68,6 +68,16 @@ namespace HTTP {
std::map<std::string, std::string> vars;
void Trim(std::string & s);
};
//HTTP::Parser class
///URL parsing class. Parses full URL into its subcomponents
class URL {
public:
URL(const std::string & url);
uint32_t getPort() const;
std::string host;///< Hostname or IP address of URL
std::string protocol;///<Protocol of URL
std::string port;///<Port of URL
std::string path;///<Path after the first slash, not inclusive
};
}//HTTP namespace