![]() |
Qore Programming Language - C/C++ Library 2.1.1
|
helps with parsing URLs and provides access to URL components through Qore data structures More...
#include <QoreURL.h>
Public Member Functions | |
| DLLEXPORT | QoreURL () |
| creates an empty structure | |
| DLLEXPORT | QoreURL (const char *url) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const char *url, bool keep_brackets) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const char *url, int options) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const QoreString &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const QoreString *url) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const QoreString *url, bool keep_brackets) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const QoreString *url, bool keep_brackets, ExceptionSink *xsink) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (const std::string &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (ExceptionSink *xsink, const char *url, int options) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (ExceptionSink *xsink, const QoreString &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT | QoreURL (ExceptionSink *xsink, const std::string &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT | ~QoreURL () |
| frees all memory and destroys the structure | |
| DLLEXPORT QoreHashNode * | getHash () |
| returns a hash of the parameters parsed, destructive: zeros out all elements, caller owns the reference count returned | |
| DLLEXPORT const QoreString * | getHost () const |
| returns the hostname of the URL | |
| DLLEXPORT const QoreString * | getPassword () const |
| returns the password in the URL or 0 if none given | |
| DLLEXPORT const QoreString * | getPath () const |
| returns the path component of the URL or 0 if none given | |
| DLLEXPORT int | getPort () const |
| returns the port number given in the URL or 0 if none present | |
| DLLEXPORT const QoreString * | getProtocol () const |
| returns the protocol component of the URL or 0 if none given | |
| DLLEXPORT const QoreString * | getUserName () const |
| returns the user name in the URL or 0 if none given | |
| DLLEXPORT bool | isValid () const |
| returns true if the URL string parsed is valid | |
| DLLEXPORT int | parse (const char *url) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const char *url, bool keep_brackets) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const char *url, int options) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const QoreString &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const QoreString *url) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const QoreString *url, bool keep_brackets) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const QoreString *url, bool keep_brackets, ExceptionSink *xsink) |
| parses the URL string passed | |
| DLLEXPORT int | parse (const std::string &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT int | parse (ExceptionSink *xsink, const char *url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT int | parse (ExceptionSink *xsink, const QoreString &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT int | parse (ExceptionSink *xsink, const std::string &url, int options=0) |
| parses the URL string passed | |
| DLLEXPORT char * | take_host () |
| returns a pointer to the hostname in the URL (0 if none present), caller owns the memory returned | |
| DLLEXPORT char * | take_password () |
| returns a pointer to the password in the URL (0 if none present), caller owns the memory returned | |
| DLLEXPORT char * | take_path () |
| returns a pointer to the path (0 if none present), caller owns the memory returned | |
| DLLEXPORT char * | take_username () |
| returns a pointer to the username in the URL (0 if none present), caller owns the memory returned | |
helps with parsing URLs and provides access to URL components through Qore data structures
| DLLEXPORT QoreURL::QoreURL | ( | ) |
creates an empty structure
| DLLEXPORT QoreURL::QoreURL | ( | const char * | url | ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| DLLEXPORT QoreURL::QoreURL | ( | const QoreString * | url | ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| DLLEXPORT QoreURL::QoreURL | ( | const char * | url, |
| bool | keep_brackets ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| DLLEXPORT QoreURL::QoreURL | ( | const QoreString * | url, |
| bool | keep_brackets ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| DLLEXPORT QoreURL::QoreURL | ( | const QoreString * | url, |
| bool | keep_brackets, | ||
| ExceptionSink * | xsink ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| xsink | for Qore-language exceptions |
| DLLEXPORT QoreURL::QoreURL | ( | const char * | url, |
| int | options ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreURL::QoreURL | ( | const QoreString & | url, |
| int | options = 0 ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreURL::QoreURL | ( | const std::string & | url, |
| int | options = 0 ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreURL::QoreURL | ( | ExceptionSink * | xsink, |
| const char * | url, | ||
| int | options ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreURL::QoreURL | ( | ExceptionSink * | xsink, |
| const QoreString & | url, | ||
| int | options = 0 ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreURL::QoreURL | ( | ExceptionSink * | xsink, |
| const std::string & | url, | ||
| int | options = 0 ) |
parses the URL string passed
you can check if the URL was valid by calling QoreURL::isValid() after this call
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT QoreHashNode * QoreURL::getHash | ( | ) |
returns a hash of the parameters parsed, destructive: zeros out all elements, caller owns the reference count returned
hash keys are:
each key is either a QoreStringNode or 0 except for port which is an integer
| DLLEXPORT const QoreString * QoreURL::getHost | ( | ) | const |
returns the hostname of the URL
| DLLEXPORT const QoreString * QoreURL::getPassword | ( | ) | const |
returns the password in the URL or 0 if none given
| DLLEXPORT const QoreString * QoreURL::getPath | ( | ) | const |
returns the path component of the URL or 0 if none given
| DLLEXPORT int QoreURL::getPort | ( | ) | const |
returns the port number given in the URL or 0 if none present
| DLLEXPORT const QoreString * QoreURL::getUserName | ( | ) | const |
returns the user name in the URL or 0 if none given
| DLLEXPORT bool QoreURL::isValid | ( | ) | const |
returns true if the URL string parsed is valid
| DLLEXPORT int QoreURL::parse | ( | const char * | url | ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string. You can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| DLLEXPORT int QoreURL::parse | ( | const char * | url, |
| bool | keep_brackets ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string. You can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| DLLEXPORT int QoreURL::parse | ( | const char * | url, |
| int | options ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT int QoreURL::parse | ( | const QoreString & | url, |
| int | options = 0 ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT int QoreURL::parse | ( | const QoreString * | url | ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string. You can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| DLLEXPORT int QoreURL::parse | ( | const QoreString * | url, |
| bool | keep_brackets ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string. You can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| DLLEXPORT int QoreURL::parse | ( | const QoreString * | url, |
| bool | keep_brackets, | ||
| ExceptionSink * | xsink ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string. You can check if the URL was valid by calling QoreURL::isValid() after this call
| url | the URL string to parse |
| keep_brackets | if this argument is true then if the hostname or address is enclosed in square brackets, then the brackets will be included in the "host" key output as well |
| xsink | for Qore-language exceptions |
| DLLEXPORT int QoreURL::parse | ( | const std::string & | url, |
| int | options = 0 ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT int QoreURL::parse | ( | ExceptionSink * | xsink, |
| const char * | url, | ||
| int | options = 0 ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT int QoreURL::parse | ( | ExceptionSink * | xsink, |
| const QoreString & | url, | ||
| int | options = 0 ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT int QoreURL::parse | ( | ExceptionSink * | xsink, |
| const std::string & | url, | ||
| int | options = 0 ) |
parses the URL string passed
If a url was already parsed previously, all memory is freed before parsing the new string.
| xsink | for Qore-language exceptions |
| url | the URL string to parse |
| options | a bitfield of Qore URL options |
| DLLEXPORT char * QoreURL::take_host | ( | ) |
returns a pointer to the hostname in the URL (0 if none present), caller owns the memory returned
if this function returns a non-zero pointer, the memory must be manually freed by the caller
| DLLEXPORT char * QoreURL::take_password | ( | ) |
returns a pointer to the password in the URL (0 if none present), caller owns the memory returned
if this function returns a non-zero pointer, the memory must be manually freed by the caller
| DLLEXPORT char * QoreURL::take_path | ( | ) |
returns a pointer to the path (0 if none present), caller owns the memory returned
if this function returns a non-zero pointer, the memory must be manually freed by the caller
| DLLEXPORT char * QoreURL::take_username | ( | ) |
returns a pointer to the username in the URL (0 if none present), caller owns the memory returned
if this function returns a non-zero pointer, the memory must be manually freed by the caller