1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_TOOLS_DUMP_CACHE_URL_UTILITIES_H_
6 #define NET_TOOLS_DUMP_CACHE_URL_UTILITIES_H_
13 // Gets the host from an url, strips the port number as well if the url
15 // For example: calling GetUrlHost(www.foo.com:8080/boo) returns www.foo.com
16 static std::string
GetUrlHost(const std::string
& url
);
18 // Get the host + path portion of an url
19 // e.g http://www.foo.com/path
20 // returns www.foo.com/path
21 static std::string
GetUrlHostPath(const std::string
& url
);
23 // Gets the path portion of an url.
24 // e.g http://www.foo.com/path
26 static std::string
GetUrlPath(const std::string
& url
);
28 // Unescape a url, converting all %XX to the the actual char 0xXX.
29 // For example, this will convert "foo%21bar" to "foo!bar".
30 static std::string
Unescape(const std::string
& escaped_url
);
35 #endif // NET_TOOLS_DUMP_CACHE_URL_UTILITIES_H_