00001
00034 #ifndef LL_LLURI_H
00035 #define LL_LLURI_H
00036
00037 #include <string>
00038
00039 class LLSD;
00040 class LLUUID;
00041 class LLApp;
00042
00049 class LLURI
00050 {
00051 public:
00052 LLURI();
00053 LLURI(const std::string& escaped_str);
00054 LLURI(const std::string& scheme,
00055 const std::string& userName,
00056 const std::string& password,
00057 const std::string& hostName,
00058 U16 hostPort,
00059 const std::string& escapedPath,
00060 const std::string& escapedQuery);
00061
00062
00063
00064 ~LLURI();
00065
00066 static LLURI buildHTTP(
00067 const std::string& prefix,
00068 const LLSD& path);
00069
00070 static LLURI buildHTTP(
00071 const std::string& prefix,
00072 const LLSD& path,
00073 const LLSD& query);
00078
00079 static LLURI buildHTTP(
00080 const std::string& host,
00081 const U32& port,
00082 const LLSD& path);
00083 static LLURI buildHTTP(
00084 const std::string& host,
00085 const U32& port,
00086 const LLSD& path,
00087 const LLSD& query);
00088
00089 std::string asString() const;
00091
00094
00095
00096
00097
00098 std::string scheme() const;
00099 std::string opaque() const;
00100
00101
00102 std::string authority() const;
00103 std::string hostName() const;
00104 std::string userName() const;
00105 std::string password() const;
00106 U16 hostPort() const;
00107 BOOL defaultPort() const;
00108 const std::string& escapedPath() const { return mEscapedPath; }
00109 std::string path() const;
00110
00111 std::string query() const;
00112 const std::string& escapedQuery() const { return mEscapedQuery; }
00113 LLSD queryMap() const;
00114 static LLSD queryMap(std::string escaped_query_string);
00115
00124 static std::string mapToQueryString(const LLSD& query_map);
00125
00128
00129
00130 static std::string escape(const std::string& str);
00131 static std::string escape(
00132 const std::string& str,
00133 const std::string & allowed);
00134 static std::string unescape(const std::string& str);
00136
00137 private:
00138 std::string mScheme;
00139 std::string mEscapedOpaque;
00140 std::string mEscapedAuthority;
00141 std::string mEscapedPath;
00142 std::string mEscapedQuery;
00143 };
00144
00145 #endif // LL_LLURI_H