51 if (protocol_pos < 0)
return false;
59 *result = protocol_end.
Substring(0, end_pos);
84 *result = path_start.
Substring(0, end_pos);
110 *result = hostport.
Substring(0, end_pos);
115 *result = trimmed_url.
Substring(0, protocol_pos);
129 *result = query_start.
Substring(0, end_pos);
151 *result = protocol_end.
Substring(0, end_pos);
171 while(trimmed_url.
len > 0) {
173 int32_t key_pos = key_search.
Search(&trimmed_url);
181 (trimmed_url.
ptr[key_pos - 1] !=
'?' && trimmed_url.
ptr[key_pos - 1] !=
'&')) {
189 if (trimmed_url.
len <= 0) {
193 if (trimmed_url.
ptr[0] !=
'=') {
198 while(pos < trimmed_url.
len) {
199 switch(trimmed_url.
ptr[pos]) {
202 *result = trimmed_url.
Substring(1, pos - 1);
217 switch(part.
ptr[0]) {
bool Eq(const StringValue &other) const
==
static const StringValue url_path
static const StringValue url_authority
const StringSearch UrlParser::colon_search & colon
const StringSearch UrlParser::slash_search & slash
const StringSearch UrlParser::protocol_search & protocol
const StringSearch UrlParser::at_search & at
int Search(const StringValue *str) const
const StringSearch UrlParser::question_search & question
const StringSearch UrlParser::hash_search & hash
static const StringValue question
static const StringSearch protocol_search
StringValue Trim() const
Trims leading and trailing spaces.
static const StringValue protocol
static const StringSearch question_search
static UrlPart GetUrlPart(const StringValue &part)
static const StringValue url_userinfo
static const StringValue url_file
static const StringValue hash
static const StringSearch at_search
static bool ParseUrlKey(const StringValue &url, UrlPart part, const StringValue &key, StringValue *result)
static const StringSearch colon_search
static const StringSearch hash_search
static const StringValue colon
static const StringValue slash
static const StringValue url_protocol
static const StringValue url_host
static bool ParseUrl(const StringValue &url, UrlPart part, StringValue *result)
StringValue Substring(int start_pos) const
Returns the substring starting at start_pos until the end of string.
static const StringValue url_ref
UrlPart
Parts of a URL that can be requested.
static const StringValue url_query
static const StringSearch slash_search
static const StringValue at