|
|
|
@ -78,11 +78,38 @@ private:
|
|
|
|
|
void read_loop(std::vector<HeaderValue> * header_values, size_t max_len); |
|
|
|
|
void read(const wchar_t * str, std::vector<HeaderValue> * header_values, size_t max_len); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* called one at the beginning of parsing |
|
|
|
|
*/ |
|
|
|
|
virtual void init() {} ; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* called when a name was parsed and was not empty |
|
|
|
|
* |
|
|
|
|
* sample: for such string: "text/html ; q = 0.5 ; charset = UTF-8" |
|
|
|
|
* parsed_name will be called with "text/html" argument |
|
|
|
|
*/ |
|
|
|
|
virtual void parsed_name(const std::wstring & name) {}; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* called when a param was parsed, param_value can be empty |
|
|
|
|
* parsed_param() is called after parsed_name() |
|
|
|
|
* |
|
|
|
|
* sample: for such string: "text/html ; q = 0.5 ; charset = UTF-8" |
|
|
|
|
* parsed_name will be called twice, first with ("q", "0.5) arguments |
|
|
|
|
* and later with ("charset", "UTF-8") |
|
|
|
|
*/ |
|
|
|
|
virtual void parsed_param(const std::wstring & param, const std::wstring & param_value) {}; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* called always when a name was parsed and was not empty |
|
|
|
|
* "q" parameter will be in the range [0.0 - 1.0] |
|
|
|
|
* |
|
|
|
|
* if there was no "q" parameter then "q" will be equal 1.0 |
|
|
|
|
*/ |
|
|
|
|
virtual void parsed_name_q(const std::wstring & name, double q) {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const wchar_t * text; |
|
|
|
|
std::wstring name; |
|
|
|
|
std::wstring param; |
|
|
|
|