All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreURL.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QoreURL.h
Network functions and macros
Qore Programming Language
Copyright 2003 - 2013 David Nichols
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _QORE_QOREURL_H
#define _QORE_QOREURL_H
class QoreURL {
private:
struct qore_url_private *priv;
DLLLOCAL void zero();
DLLLOCAL void reset();
DLLLOCAL void parseIntern(const char* url);
DLLLOCAL QoreURL(const QoreURL&);
DLLLOCAL QoreURL& operator=(const QoreURL&);
public:
DLLEXPORT QoreURL();
DLLEXPORT QoreURL(const char* url);
DLLEXPORT QoreURL(const QoreString* url);
DLLEXPORT QoreURL(const char* url, bool keep_brackets);
DLLEXPORT QoreURL(const QoreString* url, bool keep_brackets);
DLLEXPORT ~QoreURL();
DLLEXPORT int parse(const char* url);
DLLEXPORT int parse(const QoreString* url);
DLLEXPORT int parse(const char* url, bool keep_brackets);
DLLEXPORT int parse(const QoreString* url, bool keep_brackets);
DLLEXPORT bool isValid() const;
DLLEXPORT QoreHashNode* getHash();
DLLEXPORT const QoreString* getHost() const;
DLLEXPORT const QoreString* getUserName() const;
DLLEXPORT const QoreString* getPassword() const;
DLLEXPORT const QoreString* getPath() const;
DLLEXPORT const QoreString* getProtocol() const;
DLLEXPORT int getPort() const;
// the "take" methods return the char* pointers for the data
// the caller owns the memory
DLLEXPORT char* take_path();
DLLEXPORT char* take_username();
DLLEXPORT char* take_password();
DLLEXPORT char* take_host();
};
#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&#39;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