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