aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/lluri.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llcommon/lluri.h
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/lluri.h90
1 files changed, 53 insertions, 37 deletions
diff --git a/linden/indra/llcommon/lluri.h b/linden/indra/llcommon/lluri.h
index f69472f..60b3d48 100644
--- a/linden/indra/llcommon/lluri.h
+++ b/linden/indra/llcommon/lluri.h
@@ -45,54 +45,70 @@ class LLApp;
45class LLURI 45class LLURI
46{ 46{
47public: 47public:
48 LLURI(); 48 LLURI();
49 LLURI(const std::string& escaped_str); 49 LLURI(const std::string& escaped_str);
50 // construct from escaped string, as would be transmitted on the net 50 // construct from escaped string, as would be transmitted on the net
51 51
52 ~LLURI(); 52 ~LLURI();
53 53
54 static LLURI buildHTTP(const std::string& host_port, 54 static LLURI buildHTTP(const std::string& prefix,
55 const LLSD& path); 55 const LLSD& path);
56 static LLURI buildHTTP(const std::string& host_port, 56 static LLURI buildHTTP(const std::string& prefix,
57 const LLSD& path, 57 const LLSD& path,
58 const LLSD& query); 58 const LLSD& query);
59 59 // prefix is either a full URL prefix of the form "http://example.com:8080",
60 std::string asString() const; 60 // or it can be simply a host and optional port like "example.com" or
61 // the whole URI, escaped as needed 61 // "example.com:8080", in these cases, the "http://" will be added
62 62
63 // Parts of a URI 63 static LLURI buildHTTP(const std::string& host,
64 // These functions return parts of the decoded URI. The returned 64 const U32& port,
65 // strings are un-escaped as needed 65 const LLSD& path);
66 66 static LLURI buildHTTP(const std::string& host,
67 // for all schemes 67 const U32& port,
68 std::string scheme() const; // ex.: "http", note lack of colon 68 const LLSD& path,
69 std::string opaque() const; // everything after the colon 69 const LLSD& query);
70
71
72 std::string asString() const;
73 // the whole URI, escaped as needed
74
75 // Parts of a URI
76 // These functions return parts of the decoded URI. The returned
77 // strings are un-escaped as needed
78
79 // for all schemes
80 std::string scheme() const; // ex.: "http", note lack of colon
81 std::string opaque() const; // everything after the colon
82
83 // for schemes that follow path like syntax (http, https, ftp)
84 std::string authority() const; // ex.: "host.com:80"
85 std::string hostName() const; // ex.: "host.com"
86 U16 hostPort() const; // ex.: 80, will include implicit port
87 std::string path() const; // ex.: "/abc/def", includes leading slash
88 // LLSD pathArray() const; // above decoded into an array of strings
89 std::string query() const; // ex.: "x=34", section after "?"
90 LLSD queryMap() const; // above decoded into a map
91 static LLSD queryMap(std::string escaped_query_string);
70 92
71 // for schemes that follow path like syntax (http, https, ftp) 93 // Escaping Utilities
72 std::string authority() const; // ex.: "bob@host.com:80" 94 // Escape a string by urlencoding all the characters that aren't in the allowed string.
73 std::string hostName() const; // ex.: "host.com" 95 static std::string escape(const std::string& str, const std::string & allowed);
74 U16 hostPort() const; // ex.: 80, will include implicit port 96 static std::string unescape(const std::string& str);
75 std::string path() const; // ex.: "/abc/def", includes leading slash
76// LLSD pathArray() const; // above decoded into an array of strings
77 std::string query() const; // ex.: "x=34", section after "?"
78 LLSD queryMap() const; // above decoded into a map
79 static LLSD queryMap(std::string escaped_query_string);
80
81 // Escaping Utilities
82 static std::string escape(const std::string& str);
83 static std::string unescape(const std::string& str);
84 97
85 // Functions for building specific URIs for web services 98 // Functions for building specific URIs for web services
86 static LLURI buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app); 99 static LLURI buildAgentPresenceURI(const LLUUID& agent_id, LLApp* app);
87 static LLURI buildBulkAgentPresenceURI(LLApp* app); 100 static LLURI buildBulkAgentPresenceURI(LLApp* app);
101 static LLURI buildBulkAgentNamesURI(LLApp* app);
88 static LLURI buildAgentSessionURI(const LLUUID& agent_id, LLApp* app); 102 static LLURI buildAgentSessionURI(const LLUUID& agent_id, LLApp* app);
89 static LLURI buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver); 103 static LLURI buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver);
104 static LLURI buildInventoryHostURI(const LLUUID& agent_id, LLApp* app);
105 static LLURI buildAgentNameURI(const LLUUID& agent_id, LLApp* app);
90private: 106private:
91 std::string mScheme; 107 std::string mScheme;
92 std::string mEscapedOpaque; 108 std::string mEscapedOpaque;
93 std::string mEscapedAuthority; 109 std::string mEscapedAuthority;
94 std::string mEscapedPath; 110 std::string mEscapedPath;
95 std::string mEscapedQuery; 111 std::string mEscapedQuery;
96}; 112};
97 113
98#endif // LL_LLURI_H 114#endif // LL_LLURI_H