diff options
author | Pale Moon <git-repo@palemoon.org> | 2016-09-01 13:39:08 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2016-09-01 13:39:08 +0200 |
commit | 3d8ce1a11a7347cc94a937719c4bc8df46fb8d14 (patch) | |
tree | 8c26ca375a6312751c00a27e1653fb6f189f0463 /netwerk/base/src/nsURLParsers.h | |
parent | e449bdb1ec3a82f204bffdd9c3c54069d086eee3 (diff) | |
download | palemoon-gre-3d8ce1a11a7347cc94a937719c4bc8df46fb8d14.tar.gz |
Base import of Tycho code (warning: huge commit)
Diffstat (limited to 'netwerk/base/src/nsURLParsers.h')
-rw-r--r-- | netwerk/base/src/nsURLParsers.h | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/netwerk/base/src/nsURLParsers.h b/netwerk/base/src/nsURLParsers.h deleted file mode 100644 index 221f3d98d..000000000 --- a/netwerk/base/src/nsURLParsers.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsURLParsers_h__ -#define nsURLParsers_h__ - -#include "nsIURLParser.h" -#include "mozilla/Attributes.h" - -//---------------------------------------------------------------------------- -// base class for url parsers -//---------------------------------------------------------------------------- - -class nsBaseURLParser : public nsIURLParser -{ -public: - NS_DECL_NSIURLPARSER - - nsBaseURLParser() { } - -protected: - // implemented by subclasses - virtual void ParseAfterScheme(const char *spec, int32_t specLen, - uint32_t *authPos, int32_t *authLen, - uint32_t *pathPos, int32_t *pathLen) = 0; -}; - -//---------------------------------------------------------------------------- -// an url parser for urls that do not have an authority section -// -// eg. file:foo/bar.txt -// file:/foo/bar.txt (treated equivalently) -// file:///foo/bar.txt -// -// eg. file:////foo/bar.txt (UNC-filepath = \\foo\bar.txt) -// -// XXX except in this case: -// file://foo/bar.txt (the authority "foo" is ignored) -//---------------------------------------------------------------------------- - -class nsNoAuthURLParser MOZ_FINAL : public nsBaseURLParser -{ -public: - NS_DECL_ISUPPORTS - -#if defined(XP_WIN) - NS_IMETHOD ParseFilePath(const char *, int32_t, - uint32_t *, int32_t *, - uint32_t *, int32_t *, - uint32_t *, int32_t *); -#endif - - NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen, - uint32_t *usernamePos, int32_t *usernameLen, - uint32_t *passwordPos, int32_t *passwordLen, - uint32_t *hostnamePos, int32_t *hostnameLen, - int32_t *port); - - void ParseAfterScheme(const char *spec, int32_t specLen, - uint32_t *authPos, int32_t *authLen, - uint32_t *pathPos, int32_t *pathLen); -}; - -//---------------------------------------------------------------------------- -// an url parser for urls that must have an authority section -// -// eg. http:www.foo.com/bar.html -// http:/www.foo.com/bar.html -// http://www.foo.com/bar.html (treated equivalently) -// http:///www.foo.com/bar.html -//---------------------------------------------------------------------------- - -class nsAuthURLParser : public nsBaseURLParser -{ -public: - NS_DECL_ISUPPORTS - - virtual ~nsAuthURLParser() {} - - NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen, - uint32_t *usernamePos, int32_t *usernameLen, - uint32_t *passwordPos, int32_t *passwordLen, - uint32_t *hostnamePos, int32_t *hostnameLen, - int32_t *port); - - NS_IMETHOD ParseUserInfo(const char *userinfo, int32_t userinfoLen, - uint32_t *usernamePos, int32_t *usernameLen, - uint32_t *passwordPos, int32_t *passwordLen); - - NS_IMETHOD ParseServerInfo(const char *serverinfo, int32_t serverinfoLen, - uint32_t *hostnamePos, int32_t *hostnameLen, - int32_t *port); - - void ParseAfterScheme(const char *spec, int32_t specLen, - uint32_t *authPos, int32_t *authLen, - uint32_t *pathPos, int32_t *pathLen); -}; - -//---------------------------------------------------------------------------- -// an url parser for urls that may or may not have an authority section -// -// eg. http:www.foo.com (www.foo.com is authority) -// http:www.foo.com/bar.html (www.foo.com is authority) -// http:/www.foo.com/bar.html (www.foo.com is part of file path) -// http://www.foo.com/bar.html (www.foo.com is authority) -// http:///www.foo.com/bar.html (www.foo.com is part of file path) -//---------------------------------------------------------------------------- - -class nsStdURLParser : public nsAuthURLParser -{ -public: - void ParseAfterScheme(const char *spec, int32_t specLen, - uint32_t *authPos, int32_t *authLen, - uint32_t *pathPos, int32_t *pathLen); -}; - -#endif // nsURLParsers_h__ |