diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-27 21:17:45 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-27 21:17:45 (GMT) |
commit | 7b8da7c5b88714f8b4892c83703c16b19a6cb80d (patch) | |
tree | 9f78c6399274a937c662454d51ab4314ad9ec903 /src/uscxml/URL.h | |
parent | fa05389f050004a14787cd7b4ebb6e0b54e0e4af (diff) | |
download | uscxml-7b8da7c5b88714f8b4892c83703c16b19a6cb80d.zip uscxml-7b8da7c5b88714f8b4892c83703c16b19a6cb80d.tar.gz uscxml-7b8da7c5b88714f8b4892c83703c16b19a6cb80d.tar.bz2 |
New scenegraph invoker using OpenSceneGraph
Ultimately, the scenegraph invoker ought to use x3d
Diffstat (limited to 'src/uscxml/URL.h')
-rw-r--r-- | src/uscxml/URL.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/uscxml/URL.h b/src/uscxml/URL.h index 705fdb4..3a87fb1 100644 --- a/src/uscxml/URL.h +++ b/src/uscxml/URL.h @@ -5,8 +5,32 @@ #include <sstream> #include <curl/curl.h> +// use arabica URL parser +#include <io/uri.hpp> + namespace uscxml { +class URL { +public: + URL() {} + URL(const std::string uri) : _uri(uri) {} + virtual ~URL(); + const bool toAbsolute(const std::string& baseUrl); + const std::string asLocalFile(const std::string& suffix, bool reload = false); + + const bool isAbsolute() const { return _uri.is_absolute(); } + const std::string scheme() const { return _uri.scheme(); } + const std::string host() const { return _uri.host(); } + const std::string port() const { return _uri.port(); } + const std::string path() const { return _uri.path(); } + const std::string asString() const { return _uri.as_string(); } + +private: + Arabica::io::URI _uri; + std::string _localFile; + friend std::ostream & operator<<(std::ostream &stream, const URL& p); +}; + enum fcurl_type_e { CFTYPE_NONE=0, CFTYPE_FILE=1, @@ -35,15 +59,6 @@ size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file); char * url_fgets(char *ptr, size_t size, URL_FILE *file); void url_rewind(URL_FILE *file); -class URL { -public: - URL(const std::string urlString) : _urlString(urlString) {} - -private: - std::string _urlString; - friend std::ostream & operator<<(std::ostream &stream, const URL& p); -}; - std::ostream & operator<<(std::ostream &stream, const URL& url); } |