34 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY 35 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "net" 49 state st = st_param_name;
50 std::string::const_iterator start_it = query.begin();
51 std::pair<std::string, std::string> e;
52 for(std::string::const_iterator it = query.begin(); it != query.end(); it++)
59 e.first.assign(start_it, it);
60 start_it = it;++start_it;
67 e.second.assign(start_it, it);
68 start_it = it;++start_it;
70 e.first.clear();e.second.clear();
79 if(st == st_param_name)
81 if(start_it != query.end())
83 e.first.assign(start_it, query.end());
88 if(start_it != query.end())
89 e.second.assign(start_it, query.end());
103 STATIC_REGEXP_EXPR_1(rexp_match_uri,
"^([^?#]*)(\\?([^#]*))?(#(.*))?", boost::regex::icase | boost::regex::normal);
105 boost::smatch result;
106 if(!(boost::regex_search(uri, result, rexp_match_uri, boost::match_default) && result[0].matched))
108 LOG_PRINT_L1(
"[PARSE URI] regex not matched for uri: " << uri);
112 if(result[1].matched)
114 content.
m_path = result[1];
116 if(result[3].matched)
120 if(result[5].matched)
138 STATIC_REGEXP_EXPR_1(rexp_match_uri,
"^((.*?)://)?(([^/:]*)(:(\\d+))?)(.*)?", boost::regex::icase | boost::regex::normal);
141 boost::smatch result;
142 if(!(boost::regex_search(url_str, result, rexp_match_uri, boost::match_default) && result[0].matched))
144 LOG_PRINT_L1(
"[PARSE URI] regex not matched for uri: " << rexp_match_uri);
148 if(result[2].matched)
150 content.
schema = result[2];
152 if(result[4].matched)
154 content.
host = result[4];
156 if(result[6].matched)
158 content.
port = boost::lexical_cast<
uint64_t>(result[6]);
160 if(result[7].matched)
162 content.
uri = result[7];
#define STATIC_REGEXP_EXPR_1(var_name, xpr_text, reg_exp_flags)
uri_content m_uri_content
bool parse_uri(const std::string uri, http::uri_content &content)
bool parse_uri_query(const std::string &query, std::list< std::pair< std::string, std::string > > ¶ms)
unsigned __int64 uint64_t
bool parse_url(const std::string url_str, http::url_content &content)
std::list< std::pair< std::string, std::string > > m_query_params