The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
url.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * url.h - class URL: a URL parser utility class
4  *
5  * $Id: url.h 3786 2020-08-30 11:35:14Z scribe $
6  *
7  * Copyright 2004-2013 CrossWire Bible Society (http://www.crosswire.org)
8  * CrossWire Bible Society
9  * P. O. Box 2528
10  * Tempe, AZ 85280-2528
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License as published by the
14  * Free Software Foundation version 2.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  */
22 
23 #ifndef URL_H
24 #define URL_H
25 
26 #include <swbuf.h>
27 #include <map>
28 
30 
35 public:
36  typedef std::map<SWBuf, SWBuf> ParameterMap;
37 
41  URL(const char *url);
42 
46  const char *getProtocol() const;
50  const char *getHostName() const;
54  const char *getPath() const;
55 
59  const ParameterMap &getParameters() const;
60 
67  const char *getParameterValue(const char *name) const;
68 
76  static const SWBuf encode(const char *urlText);
77  static const SWBuf decode(const char *encodedText);
78 
79 private:
83  void parse();
84 
90 };
91 
93 
94 #endif //URL_H
#define SWORD_NAMESPACE_START
Definition: defs.h:39
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
SWBuf hostname
Definition: url.h:87
std::map< SWBuf, SWBuf > ParameterMap
Definition: url.h:36
SWBuf url
Definition: url.h:85
SWBuf protocol
Definition: url.h:86
Definition: url.h:34
#define SWORD_NAMESPACE_END
Definition: defs.h:40
SWBuf path
Definition: url.h:88
ParameterMap parameterMap
Definition: url.h:89