diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 21:19:45 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-18 21:19:45 +0000 |
commit | 318076b4adca3868e0f2438953e69f2ce2d6336f (patch) | |
tree | 98d4c5d4a5442c86c526cca6538a099de4f04360 /url/url_parse.h | |
parent | 3c9185a2ddfbe06f42d0aca50d1a6e33b3ed3a8b (diff) | |
download | chromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.zip chromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.tar.gz chromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.tar.bz2 |
url: Build it as a static library.
This is temporary just to avoid weird link issues in Windows XP.
- Update the gyp file.
- Rename the gyp file from googleurl.gyp to url.gyp, so it matches the directory
name.
- Update the header include paths.
- Update the header include guards.
- Rename the target name from googleurl to url and googleurl_unittests to
url_unittests.
- Remove GURL_API (this will be replaced by URL_EXPORT when we componentize it again).
- Remove url_common.h (will be replaced by url_export.h when we componentize it again).
BUG=229660
TEST=url_unittests
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/13998025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url/url_parse.h')
-rw-r--r-- | url/url_parse.h | 111 |
1 files changed, 55 insertions, 56 deletions
diff --git a/url/url_parse.h b/url/url_parse.h index 3dbe98a..d1c3593 100644 --- a/url/url_parse.h +++ b/url/url_parse.h @@ -27,14 +27,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_PARSE_H__ -#define GOOGLEURL_SRC_URL_PARSE_H__ +#ifndef URL_URL_PARSE_H_ +#define URL_URL_PARSE_H_ #include <string> #include "base/basictypes.h" #include "base/string16.h" -#include "googleurl/src/url_common.h" namespace url_parse { @@ -121,10 +120,10 @@ struct Parsed { // The default constructor is sufficient for the components, but inner_parsed_ // requires special handling. - GURL_API Parsed(); - GURL_API Parsed(const Parsed&); - GURL_API Parsed& operator=(const Parsed&); - GURL_API ~Parsed(); + Parsed(); + Parsed(const Parsed&); + Parsed& operator=(const Parsed&); + ~Parsed(); // Returns the length of the URL (the end of the last component). // @@ -132,7 +131,7 @@ struct Parsed { // of the string. For example "http://": the parsed structure will only // contain an entry for the four-character scheme, and it doesn't know about // the "://". For all other last-components, it will return the real length. - GURL_API int Length() const; + int Length() const; // Returns the number of characters before the given component if it exists, // or where the component would be if it did exist. This will return the @@ -160,8 +159,8 @@ struct Parsed { // *QUERY: 14 15 <- // *REF: 20 20 // - GURL_API int CountCharactersBefore(ComponentType type, - bool include_delimiter) const; + int CountCharactersBefore(ComponentType type, + bool include_delimiter) const; // Scheme without the colon: "http://foo"/ would have a scheme of "http". // The length will be -1 if no scheme is specified ("foo.com"), or 0 if there @@ -246,32 +245,32 @@ struct Parsed { // StandardURL is for when the scheme is known to be one that has an // authority (host) like "http". This function will not handle weird ones // like "about:" and "javascript:", or do the right thing for "file:" URLs. -GURL_API void ParseStandardURL(const char* url, int url_len, Parsed* parsed); -GURL_API void ParseStandardURL(const char16* url, int url_len, Parsed* parsed); +void ParseStandardURL(const char* url, int url_len, Parsed* parsed); +void ParseStandardURL(const char16* url, int url_len, Parsed* parsed); // PathURL is for when the scheme is known not to have an authority (host) // section but that aren't file URLs either. The scheme is parsed, and // everything after the scheme is considered as the path. This is used for // things like "about:" and "javascript:" -GURL_API void ParsePathURL(const char* url, int url_len, Parsed* parsed); -GURL_API void ParsePathURL(const char16* url, int url_len, Parsed* parsed); +void ParsePathURL(const char* url, int url_len, Parsed* parsed); +void ParsePathURL(const char16* url, int url_len, Parsed* parsed); // FileURL is for file URLs. There are some special rules for interpreting // these. -GURL_API void ParseFileURL(const char* url, int url_len, Parsed* parsed); -GURL_API void ParseFileURL(const char16* url, int url_len, Parsed* parsed); +void ParseFileURL(const char* url, int url_len, Parsed* parsed); +void ParseFileURL(const char16* url, int url_len, Parsed* parsed); // Filesystem URLs are structured differently than other URLs. -GURL_API void ParseFileSystemURL(const char* url, - int url_len, - Parsed* parsed); -GURL_API void ParseFileSystemURL(const char16* url, - int url_len, - Parsed* parsed); +void ParseFileSystemURL(const char* url, + int url_len, + Parsed* parsed); +void ParseFileSystemURL(const char16* url, + int url_len, + Parsed* parsed); // MailtoURL is for mailto: urls. They are made up scheme,path,query -GURL_API void ParseMailtoURL(const char* url, int url_len, Parsed* parsed); -GURL_API void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed); +void ParseMailtoURL(const char* url, int url_len, Parsed* parsed); +void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed); // Helper functions ----------------------------------------------------------- @@ -295,27 +294,27 @@ GURL_API void ParseMailtoURL(const char16* url, int url_len, Parsed* parsed); // end of the string). // // The 8-bit version requires UTF-8 encoding. -GURL_API bool ExtractScheme(const char* url, int url_len, Component* scheme); -GURL_API bool ExtractScheme(const char16* url, int url_len, Component* scheme); +bool ExtractScheme(const char* url, int url_len, Component* scheme); +bool ExtractScheme(const char16* url, int url_len, Component* scheme); // Returns true if ch is a character that terminates the authority segment // of a URL. -GURL_API bool IsAuthorityTerminator(char16 ch); +bool IsAuthorityTerminator(char16 ch); // Does a best effort parse of input |spec|, in range |auth|. If a particular // component is not found, it will be set to invalid. -GURL_API void ParseAuthority(const char* spec, - const Component& auth, - Component* username, - Component* password, - Component* hostname, - Component* port_num); -GURL_API void ParseAuthority(const char16* spec, - const Component& auth, - Component* username, - Component* password, - Component* hostname, - Component* port_num); +void ParseAuthority(const char* spec, + const Component& auth, + Component* username, + Component* password, + Component* hostname, + Component* port_num); +void ParseAuthority(const char16* spec, + const Component& auth, + Component* username, + Component* password, + Component* hostname, + Component* port_num); // Computes the integer port value from the given port component. The port // component should have been identified by one of the init functions on @@ -324,8 +323,8 @@ GURL_API void ParseAuthority(const char16* spec, // The return value will be a positive integer between 0 and 64K, or one of // the two special values below. enum SpecialPort { PORT_UNSPECIFIED = -1, PORT_INVALID = -2 }; -GURL_API int ParsePort(const char* url, const Component& port); -GURL_API int ParsePort(const char16* url, const Component& port); +int ParsePort(const char* url, const Component& port); +int ParsePort(const char16* url, const Component& port); // Extracts the range of the file name in the given url. The path must // already have been computed by the parse function, and the matching URL @@ -337,12 +336,12 @@ GURL_API int ParsePort(const char16* url, const Component& port); // following the last slash. // // The 8-bit version requires UTF-8 encoding. -GURL_API void ExtractFileName(const char* url, - const Component& path, - Component* file_name); -GURL_API void ExtractFileName(const char16* url, - const Component& path, - Component* file_name); +void ExtractFileName(const char* url, + const Component& path, + Component* file_name); +void ExtractFileName(const char16* url, + const Component& path, + Component* file_name); // Extract the first key/value from the range defined by |*query|. Updates // |*query| to start at the end of the extracted key/value pair. This is @@ -359,15 +358,15 @@ GURL_API void ExtractFileName(const char16* url, // // If no key/value are found |*key| and |*value| will be unchanged and it will // return false. -GURL_API bool ExtractQueryKeyValue(const char* url, - Component* query, - Component* key, - Component* value); -GURL_API bool ExtractQueryKeyValue(const char16* url, - Component* query, - Component* key, - Component* value); +bool ExtractQueryKeyValue(const char* url, + Component* query, + Component* key, + Component* value); +bool ExtractQueryKeyValue(const char16* url, + Component* query, + Component* key, + Component* value); } // namespace url_parse -#endif // GOOGLEURL_SRC_URL_PARSE_H__ +#endif // URL_URL_PARSE_H_ |