Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / net / tools / dump_cache / url_utilities.h
blobc9d8ea5f8e60caf7e2ab15ce5e773fbf0c466f9c
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_
8 #include <string>
10 namespace net {
12 struct UrlUtilities {
13 // Gets the host from an url, strips the port number as well if the url
14 // has one.
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
25 // returns /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);
33 } // namespace net
35 #endif // NET_TOOLS_DUMP_CACHE_URL_UTILITIES_H_