00001
00002
00003
00004 #ifndef DMLITE_CPP_UTILS_URLS_H
00005 #define DMLITE_CPP_UTILS_URLS_H
00006
00007 #include <string>
00008 #include <vector>
00009 #include "extensible.h"
00010
00011 namespace dmlite {
00012
00013 struct Url {
00014 std::string scheme;
00015 std::string domain;
00016 unsigned port;
00017 std::string path;
00018 Extensible query;
00019
00020 Url() throw();
00021 explicit Url(const std::string& url) throw ();
00022
00023
00024 bool operator == (const Url&) const;
00025 bool operator != (const Url&) const;
00026 bool operator < (const Url&) const;
00027 bool operator > (const Url&) const;
00028
00029 std::string queryToString(void) const;
00030 void queryFromString(const std::string& str);
00031
00032
00033 std::string toString(void) const;
00034
00035
00036
00037
00038 static std::vector<std::string> splitPath(const std::string& path) throw ();
00039
00040
00041 static std::string joinPath(const std::vector<std::string>& components) throw();
00042
00043
00044 static std::string normalizePath(const std::string& path) throw ();
00045 };
00046 };
00047
00048 #endif // DMLITE_CPP_UTILS_URLS_H