00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _SWORD_BASE_URI_
00020 #define _SWORD_BASE_URI_
00021
00022 #include "sword/base.URIScheme.h"
00023
00024 namespace sword {
00025
00027
00062 class SWORDDECL URI {
00063 public:
00065 URI();
00066
00068 URI(const std::string &uri);
00069
00071 URI(const URI &uri);
00072
00073 ~URI();
00074
00076 URI &operator=(const URI &uri);
00077
00079 URI &operator=(const std::string &uri);
00080
00082 friend URI operator+(const URI &lhs, const std::string &rhs);
00083
00085 URI &operator+=(const std::string &rhs);
00086
00088 std::string toString() const;
00089
00091 bool empty() const;
00092
00094 const URIScheme &scheme() const;
00095
00097 const std::string &pathname() const;
00098
00100 std::string path() const;
00101
00103 std::string filename() const;
00104
00105 private:
00106 PURIScheme scheme_;
00107 std::string pathname_;
00108
00109 void parse_ (const std::string &str);
00110 void navigate_(const std::string &str);
00111 void canonize_();
00112 };
00113
00114 class InvalidURIException : public Exception {};
00115
00116 }
00117
00118 #include "sword.private/base.URI.inl"
00119
00120 #endif // _SWORD_BASE_URI_