|
Qore Programming Language
0.8.3
|
00001 /* -*- mode: c++; indent-tabs-mode: nil -*- */ 00002 /* 00003 QoreURL.h 00004 00005 Network functions and macros 00006 00007 Qore Programming Language 00008 00009 Copyright 2003 - 2011 David Nichols 00010 00011 This library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU Lesser General Public 00013 License as published by the Free Software Foundation; either 00014 version 2.1 of the License, or (at your option) any later version. 00015 00016 This library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Lesser General Public License for more details. 00020 00021 You should have received a copy of the GNU Lesser General Public 00022 License along with this library; if not, write to the Free Software 00023 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 */ 00025 00026 #ifndef _QORE_QOREURL_H 00027 00028 #define _QORE_QOREURL_H 00029 00031 class QoreURL { 00032 private: 00034 struct qore_url_private *priv; 00035 00036 DLLLOCAL void zero(); 00037 DLLLOCAL void reset(); 00038 DLLLOCAL void parseIntern(const char *url); 00039 00041 DLLLOCAL QoreURL(const QoreURL&); 00042 00044 DLLLOCAL QoreURL& operator=(const QoreURL&); 00045 00046 public: 00048 00050 DLLEXPORT QoreURL(); 00051 00053 00056 DLLEXPORT QoreURL(const char *url); 00057 00059 00062 DLLEXPORT QoreURL(const class QoreString *url); 00063 00065 DLLEXPORT ~QoreURL(); 00066 00068 00072 DLLEXPORT int parse(const char *url); 00073 00075 00079 DLLEXPORT int parse(const class QoreString *url); 00080 00082 00084 DLLEXPORT bool isValid() const; 00085 00087 00099 DLLEXPORT QoreHashNode *getHash(); 00100 00102 00104 DLLEXPORT const QoreString *getHost() const; 00105 00107 00109 DLLEXPORT const QoreString *getUserName() const; 00110 00112 00114 DLLEXPORT const QoreString *getPassword() const; 00115 00117 00119 DLLEXPORT const QoreString *getPath() const; 00120 00122 DLLEXPORT const QoreString *getProtocol() const; 00123 00125 00127 DLLEXPORT int getPort() const; 00128 00129 // the "take" methods return the char * pointers for the data 00130 // the caller owns the memory 00131 00133 00136 DLLEXPORT char *take_path(); 00137 00139 00142 DLLEXPORT char *take_username(); 00143 00145 00148 DLLEXPORT char *take_password(); 00149 00151 00154 DLLEXPORT char *take_host(); 00155 }; 00156 00157 #endif