Qore Programming Language: include/qore/QoreURL.h (6585) Source File

Qore Programming Language 0.8.11

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreURL.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3 QoreURL.h
4
5 Network functions and macros
6
7 Qore Programming Language
8
9 Copyright 2003 - 2013 David Nichols
10
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Lesser General Public
13 License as published by the Free Software Foundation; either
14 version 2.1 of the License, or (at your option) any later version.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public
22 License along with this library; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26 #ifndef _QORE_QOREURL_H
27
28 #define _QORE_QOREURL_H
29
31 class QoreURL {
32 private:
34 struct qore_url_private *priv;
35
36 DLLLOCAL void zero();
37 DLLLOCAL void reset();
38 DLLLOCAL void parseIntern(const char* url);
39
41 DLLLOCAL QoreURL(const QoreURL&);
42
44 DLLLOCAL QoreURL& operator=(const QoreURL&);
45
46 public:
48
50 DLLEXPORT QoreURL();
51
53
56 DLLEXPORT QoreURL(const char* url);
57
59
62 DLLEXPORT QoreURL(const QoreString* url);
63
65
69 DLLEXPORT QoreURL(const char* url, bool keep_brackets);
70
72
76 DLLEXPORT QoreURL(const QoreString* url, bool keep_brackets);
77
79 DLLEXPORT ~QoreURL();
80
82
86 DLLEXPORT int parse(const char* url);
87
89
93 DLLEXPORT int parse(const QoreString* url);
94
96
102 DLLEXPORT int parse(const char* url, bool keep_brackets);
103
105
111 DLLEXPORT int parse(const QoreString* url, bool keep_brackets);
112
114
116 DLLEXPORT bool isValid() const;
117
119
131 DLLEXPORT QoreHashNode* getHash();
132
134
136 DLLEXPORT const QoreString* getHost() const;
137
139
141 DLLEXPORT const QoreString* getUserName() const;
142
144
146 DLLEXPORT const QoreString* getPassword() const;
147
149
151 DLLEXPORT const QoreString* getPath() const;
152
154 DLLEXPORT const QoreString* getProtocol() const;
155
157
159 DLLEXPORT int getPort() const;
160
161 // the "take" methods return the char* pointers for the data
162 // the caller owns the memory
163
165
168 DLLEXPORT char* take_path();
169
171
174 DLLEXPORT char* take_username();
175
177
180 DLLEXPORT char* take_password();
181
183
186 DLLEXPORT char* take_host();
187 };
188
189 #endif
QoreURL::take_username
DLLEXPORT char * take_username()
returns a pointer to the username in the URL (0 if none present), caller owns the memory returned ...
QoreURL::~QoreURL
DLLEXPORT ~QoreURL()
frees all memory and destroys the structure
QoreURL::isValid
DLLEXPORT bool isValid() const
returns true if the URL string parsed is valid
QoreHashNode
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:41
QoreURL::getProtocol
DLLEXPORT const QoreString * getProtocol() const
returns the protocol component of the URL or 0 if none given
QoreURL::parse
DLLEXPORT int parse(const char *url)
parses the URL string passed
QoreURL::getHash
DLLEXPORT QoreHashNode * getHash()
returns a hash of the parameters parsed, destructive: zeros out all elements, caller owns the referen...
QoreURL
helps with parsing URLs and provides access to URL components through Qore data structures ...
Definition: QoreURL.h:31
QoreURL::getUserName
DLLEXPORT const QoreString * getUserName() const
returns the user name in the URL or 0 if none given
QoreURL::getHost
DLLEXPORT const QoreString * getHost() const
returns the hostname of the URL
QoreURL::take_password
DLLEXPORT char * take_password()
returns a pointer to the password in the URL (0 if none present), caller owns the memory returned ...
QoreURL::getPort
DLLEXPORT int getPort() const
returns the port number given in the URL or 0 if none present
QoreString
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:42
QoreURL::getPath
DLLEXPORT const QoreString * getPath() const
returns the path component of the URL or 0 if none given
QoreURL::take_path
DLLEXPORT char * take_path()
returns a pointer to the path (0 if none present), caller owns the memory returned ...
QoreURL::getPassword
DLLEXPORT const QoreString * getPassword() const
returns the password in the URL or 0 if none given
QoreURL::take_host
DLLEXPORT char * take_host()
returns a pointer to the hostname in the URL (0 if none present), caller owns the memory returned ...
QoreURL::QoreURL
DLLEXPORT QoreURL()
creates an empty structure