summaryrefslogtreecommitdiff
path: root/doc/html/Http_8hpp-source.htm
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/Http_8hpp-source.htm')
-rwxr-xr-xdoc/html/Http_8hpp-source.htm121
1 files changed, 64 insertions, 57 deletions
diff --git a/doc/html/Http_8hpp-source.htm b/doc/html/Http_8hpp-source.htm
index a8df86c..b22c4ae 100755
--- a/doc/html/Http_8hpp-source.htm
+++ b/doc/html/Http_8hpp-source.htm
@@ -10,19 +10,25 @@
<div id="logo">
<img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
</div>
-<!-- Generated by Doxygen 1.5.2 -->
-<div class="tabs">
- <ul>
- <li><a href="index.htm"><span>Main&nbsp;Page</span></a></li>
- <li><a href="namespaces.htm"><span>Namespaces</span></a></li>
- <li><a href="classes.htm"><span>Classes</span></a></li>
- <li class="current"><a href="files.htm"><span>Files</span></a></li>
- </ul>
-</div>
+<!-- Generated by Doxygen 1.5.8 -->
+<div class="navigation" id="top">
+ <div class="tabs">
+ <ul>
+ <li><a href="index.htm"><span>Main&nbsp;Page</span></a></li>
+ <li><a href="namespaces.htm"><span>Namespaces</span></a></li>
+ <li><a href="annotated.htm"><span>Classes</span></a></li>
+ <li class="current"><a href="files.htm"><span>Files</span></a></li>
+ </ul>
+ </div>
+ <div class="tabs">
+ <ul>
+ <li><a href="files.htm"><span>File&nbsp;List</span></a></li>
+ </ul>
+ </div>
<h1>Http.hpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// SFML - Simple and Fast Multimedia Library</span>
-<a name="l00004"></a>00004 <span class="comment">// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)</span>
+<a name="l00004"></a>00004 <span class="comment">// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This software is provided 'as-is', without any express or implied warranty.</span>
<a name="l00007"></a>00007 <span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span>
@@ -55,22 +61,22 @@
<a name="l00037"></a>00037
<a name="l00038"></a>00038 <span class="keyword">namespace </span>sf
<a name="l00039"></a>00039 {
-<a name="l00045"></a><a class="code" href="classsf_1_1Http.htm">00045</a> <span class="keyword">class </span>SFML_API Http : <a class="code" href="structsf_1_1NonCopyable.htm" title="Utility base class to easily declare non-copyable classes.">NonCopyable</a>
+<a name="l00045"></a><a class="code" href="classsf_1_1Http.htm">00045</a> <span class="keyword">class </span>SFML_API <a class="code" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a> : <a class="code" href="structsf_1_1NonCopyable.htm" title="Utility base class to easily declare non-copyable classes.">NonCopyable</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">public</span> :
<a name="l00048"></a>00048
-<a name="l00054"></a><a class="code" href="classsf_1_1Http_1_1Request.htm">00054</a> <span class="keyword">class </span>SFML_API Request
+<a name="l00054"></a><a class="code" href="classsf_1_1Http_1_1Request.htm">00054</a> <span class="keyword">class </span>SFML_API <a class="code" href="classsf_1_1Http_1_1Request.htm" title="This class wraps an HTTP request, which is basically :a header with a method, a target...">Request</a>
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056 <span class="keyword">public</span> :
<a name="l00057"></a>00057
<a name="l00061"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598">00061</a> <span class="keyword">enum</span> <a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598" title="Enumerate the available HTTP methods for a request.">Method</a>
<a name="l00062"></a>00062 {
-<a name="l00063"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598b822baed393f3d0353621e5378b9fcb4">00063</a> Get,
-<a name="l00064"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598e8ec4048b9550f8d0747d4199603141a">00064</a> Post,
-<a name="l00065"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf55984df23138be7ed60f47aba6548ba65e7b">00065</a> Head
+<a name="l00063"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598f6c1b04e35501cd5f5a85207c2b37f00">00063</a> Get,
+<a name="l00064"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf559887aa7a9c6147016f57c5ff1c5cac6138">00064</a> Post,
+<a name="l00065"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598d1642aed133fbd3cb4fcff0f558e6ee5">00065</a> Head
<a name="l00066"></a>00066 };
<a name="l00067"></a>00067
-<a name="l00076"></a>00076 Request(Method RequestMethod = Get, <span class="keyword">const</span> std::string&amp; URI = <span class="stringliteral">"/"</span>, <span class="keyword">const</span> std::string&amp; Body = <span class="stringliteral">""</span>);
+<a name="l00076"></a>00076 <a class="code" href="classsf_1_1Http_1_1Request.htm" title="This class wraps an HTTP request, which is basically :a header with a method, a target...">Request</a>(Method RequestMethod = Get, <span class="keyword">const</span> std::string&amp; URI = <span class="stringliteral">"/"</span>, <span class="keyword">const</span> std::string&amp; Body = <span class="stringliteral">""</span>);
<a name="l00077"></a>00077
<a name="l00085"></a>00085 <span class="keywordtype">void</span> SetField(<span class="keyword">const</span> std::string&amp; Field, <span class="keyword">const</span> std::string&amp; Value);
<a name="l00086"></a>00086
@@ -84,7 +90,7 @@
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <span class="keyword">private</span> :
<a name="l00126"></a>00126
-<a name="l00127"></a><a class="code" href="classsf_1_1Http_1_1Request.htm#ba95e2a7762bb5df986048b05d03a22e">00127</a> <span class="keyword">friend</span> <span class="keyword">class </span>Http;
+<a name="l00127"></a>00127 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a>;
<a name="l00128"></a>00128
<a name="l00135"></a>00135 std::string ToString() <span class="keyword">const</span>;
<a name="l00136"></a>00136
@@ -95,49 +101,49 @@
<a name="l00151"></a>00151
<a name="l00153"></a>00153 <span class="comment">// Member data</span>
<a name="l00155"></a>00155 <span class="comment"></span> FieldTable myFields;
-<a name="l00156"></a>00156 <a class="code" href="classsf_1_1Http_1_1Request.htm#620f8bff6f43e1378f321bf53fbf5598" title="Enumerate the available HTTP methods for a request.">Method</a> myMethod;
+<a name="l00156"></a>00156 Method myMethod;
<a name="l00157"></a>00157 std::string myURI;
<a name="l00158"></a>00158 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myMajorVersion;
<a name="l00159"></a>00159 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myMinorVersion;
<a name="l00160"></a>00160 std::string myBody;
<a name="l00161"></a>00161 };
<a name="l00162"></a>00162
-<a name="l00168"></a><a class="code" href="classsf_1_1Http_1_1Response.htm">00168</a> <span class="keyword">class </span>SFML_API Response
+<a name="l00168"></a><a class="code" href="classsf_1_1Http_1_1Response.htm">00168</a> <span class="keyword">class </span>SFML_API <a class="code" href="classsf_1_1Http_1_1Response.htm" title="This class wraps an HTTP response, which is basically :a header with a status code...">Response</a>
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170 <span class="keyword">public</span> :
<a name="l00171"></a>00171
<a name="l00176"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8">00176</a> <span class="keyword">enum</span> <a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8" title="Enumerate all the valid status codes returned in a HTTP response.">Status</a>
<a name="l00177"></a>00177 {
<a name="l00178"></a>00178 <span class="comment">// 2xx: success</span>
-<a name="l00179"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d80158f932254d3f09647dd1f64bd43832">00179</a> Ok = 200,
-<a name="l00180"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d80a6e8bafa9365a0ed10b8a9cbfd0649b">00180</a> Created = 201,
-<a name="l00181"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8d328945457bd2f0d65107ba6b5ccd443">00181</a> Accepted = 202,
-<a name="l00182"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8efde9e4abf5682dcd314d63143be42e0">00182</a> NoContent = 204,
+<a name="l00179"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d851b3f82163c2a9da6d0b59861438a6e5">00179</a> Ok = 200,
+<a name="l00180"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8b81740668f9aaaeac28ad29e770e0ac0">00180</a> Created = 201,
+<a name="l00181"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d85f1413adbb3239ffc1106698da8eaaae">00181</a> Accepted = 202,
+<a name="l00182"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d871242772df8d6c5c007fc5515b193ca3">00182</a> NoContent = 204,
<a name="l00183"></a>00183
<a name="l00184"></a>00184 <span class="comment">// 3xx: redirection</span>
-<a name="l00185"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8dd95cbd8fa27516821f763488557f96b">00185</a> MultipleChoices = 300,
-<a name="l00186"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d82f91651db3a09628faf68cbcefa0810a">00186</a> MovedPermanently = 301,
-<a name="l00187"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d805c50d7b17c844e0b909e5802d5f1587">00187</a> MovedTemporarily = 302,
-<a name="l00188"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8060ebc3af266e6bfe045b89e298e2545">00188</a> NotModified = 304,
+<a name="l00185"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d873852d5b7aae546a393b52ed617765d2">00185</a> MultipleChoices = 300,
+<a name="l00186"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8959223a6657a518f8fac7988ee37d9f0">00186</a> MovedPermanently = 301,
+<a name="l00187"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8c0d40f800acc7b2fbfb308db7076c015">00187</a> MovedTemporarily = 302,
+<a name="l00188"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8c1869be5ad599bce333ec31e338aad56">00188</a> NotModified = 304,
<a name="l00189"></a>00189
<a name="l00190"></a>00190 <span class="comment">// 4xx: client error</span>
-<a name="l00191"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d83f88a714cf5483ee22f9051e5a3c080a">00191</a> BadRequest = 400,
-<a name="l00192"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8b7a79b7bff50fb1902c19eecbb4e2a2d">00192</a> Unauthorized = 401,
-<a name="l00193"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d864492842e823ebe12a85539b6b454986">00193</a> Forbidden = 403,
-<a name="l00194"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8ffca8a8319a62d98bd3ef90ff5cfc030">00194</a> NotFound = 404,
+<a name="l00191"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d80d8bd04dc52e2682b2c1a16e791f8caa">00191</a> BadRequest = 400,
+<a name="l00192"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d815420ced21fd9d1e5164b3d497db328e">00192</a> Unauthorized = 401,
+<a name="l00193"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8c6741fac3c5ae4ee2edabc47713abdcf">00193</a> Forbidden = 403,
+<a name="l00194"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8ba6a54a26a9fe3d52ab0dd6930b73e41">00194</a> NotFound = 404,
<a name="l00195"></a>00195
<a name="l00196"></a>00196 <span class="comment">// 5xx: server error</span>
-<a name="l00197"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8dae2b2a936414349d55b4ed8c583fed1">00197</a> InternalServerError = 500,
-<a name="l00198"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d86920ba06d7e2bcf0b325da23ee95ef68">00198</a> NotImplemented = 501,
-<a name="l00199"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8ad0cbad4cdaf448beb763e86bc1f747c">00199</a> BadGateway = 502,
-<a name="l00200"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8c4fffba9d5ad4c14171a1bbe4f6adf87">00200</a> ServiceNotAvailable = 503,
+<a name="l00197"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d832fc48d61841e3647702775eed2edb3a">00197</a> InternalServerError = 500,
+<a name="l00198"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8195621707d16bfa766a5bfe88519f1cf">00198</a> NotImplemented = 501,
+<a name="l00199"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d835e1dac1fed604a1b79266b69beccde9">00199</a> BadGateway = 502,
+<a name="l00200"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8ca3d7619d3532ee3f09af857e1e45b8c">00200</a> ServiceNotAvailable = 503,
<a name="l00201"></a>00201
<a name="l00202"></a>00202 <span class="comment">// 10xx: SFML custom codes</span>
-<a name="l00203"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d80af0090420e60bf54da4860749345c95">00203</a> InvalidResponse = 1000,
-<a name="l00204"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d87f307376f13bdc06b24fc274ecd2aa60">00204</a> ConnectionFailed = 1001
+<a name="l00203"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8acd062103f0975b1c2078bea0d91d5a8">00203</a> InvalidResponse = 1000,
+<a name="l00204"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d85c8ef4342e03b4d2325521ea40f035fa">00204</a> ConnectionFailed = 1001
<a name="l00205"></a>00205 };
<a name="l00206"></a>00206
-<a name="l00211"></a>00211 Response();
+<a name="l00211"></a>00211 <a class="code" href="classsf_1_1Http_1_1Response.htm" title="This class wraps an HTTP response, which is basically :a header with a status code...">Response</a>();
<a name="l00212"></a>00212
<a name="l00221"></a>00221 <span class="keyword">const</span> std::string&amp; GetField(<span class="keyword">const</span> std::string&amp; Field) <span class="keyword">const</span>;
<a name="l00222"></a>00222
@@ -151,7 +157,7 @@
<a name="l00258"></a>00258
<a name="l00259"></a>00259 <span class="keyword">private</span> :
<a name="l00260"></a>00260
-<a name="l00261"></a><a class="code" href="classsf_1_1Http_1_1Response.htm#ba95e2a7762bb5df986048b05d03a22e">00261</a> <span class="keyword">friend</span> <span class="keyword">class </span>Http;
+<a name="l00261"></a>00261 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a>;
<a name="l00262"></a>00262
<a name="l00269"></a>00269 <span class="keywordtype">void</span> FromString(<span class="keyword">const</span> std::string&amp; Data);
<a name="l00270"></a>00270
@@ -160,34 +166,35 @@
<a name="l00275"></a>00275
<a name="l00277"></a>00277 <span class="comment">// Member data</span>
<a name="l00279"></a>00279 <span class="comment"></span> FieldTable myFields;
-<a name="l00280"></a>00280 <a class="code" href="classsf_1_1Http_1_1Response.htm#663e071978e30fbbeb20ed045be874d8" title="Enumerate all the valid status codes returned in a HTTP response.">Status</a> myStatus;
+<a name="l00280"></a>00280 Status myStatus;
<a name="l00281"></a>00281 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myMajorVersion;
<a name="l00282"></a>00282 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myMinorVersion;
<a name="l00283"></a>00283 std::string myBody;
<a name="l00284"></a>00284 };
<a name="l00285"></a>00285
-<a name="l00290"></a>00290 Http();
+<a name="l00290"></a>00290 <a class="code" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a>();
<a name="l00291"></a>00291
-<a name="l00299"></a>00299 Http(<span class="keyword">const</span> std::string&amp; Host, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> Port = 0);
+<a name="l00299"></a>00299 <a class="code" href="classsf_1_1Http.htm" title="This class provides methods for manipulating the HTTP protocol (described in RFC...">Http</a>(<span class="keyword">const</span> std::string&amp; Host, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> Port = 0);
<a name="l00300"></a>00300
<a name="l00308"></a>00308 <span class="keywordtype">void</span> SetHost(<span class="keyword">const</span> std::string&amp; Host, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> Port = 0);
<a name="l00309"></a>00309
-<a name="l00323"></a>00323 Response SendRequest(<span class="keyword">const</span> Request&amp; Req);
-<a name="l00324"></a>00324
-<a name="l00325"></a>00325 <span class="keyword">private</span> :
-<a name="l00326"></a>00326
-<a name="l00328"></a>00328 <span class="comment">// Member data</span>
-<a name="l00330"></a>00330 <span class="comment"></span> <a class="code" href="classsf_1_1SocketTCP.htm" title="SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower)...">SocketTCP</a> myConnection;
-<a name="l00331"></a>00331 <a class="code" href="classsf_1_1IPAddress.htm" title="IPAddress provides easy manipulation of IP v4 addresses.">IPAddress</a> myHost;
-<a name="l00332"></a>00332 std::string myHostName;
-<a name="l00333"></a>00333 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> myPort;
-<a name="l00334"></a>00334 };
-<a name="l00335"></a>00335
-<a name="l00336"></a>00336 } <span class="comment">// namespace sf</span>
-<a name="l00337"></a>00337
+<a name="l00324"></a>00324 Response SendRequest(<span class="keyword">const</span> Request&amp; Req, <span class="keywordtype">float</span> Timeout = 0.f);
+<a name="l00325"></a>00325
+<a name="l00326"></a>00326 <span class="keyword">private</span> :
+<a name="l00327"></a>00327
+<a name="l00329"></a>00329 <span class="comment">// Member data</span>
+<a name="l00331"></a>00331 <span class="comment"></span> <a class="code" href="classsf_1_1SocketTCP.htm" title="SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower)...">SocketTCP</a> myConnection;
+<a name="l00332"></a>00332 <a class="code" href="classsf_1_1IPAddress.htm" title="IPAddress provides easy manipulation of IP v4 addresses.">IPAddress</a> myHost;
+<a name="l00333"></a>00333 std::string myHostName;
+<a name="l00334"></a>00334 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> myPort;
+<a name="l00335"></a>00335 };
+<a name="l00336"></a>00336
+<a name="l00337"></a>00337 } <span class="comment">// namespace sf</span>
<a name="l00338"></a>00338
-<a name="l00339"></a>00339 <span class="preprocessor">#endif // SFML_HTTP_HPP</span>
-</pre></div>
+<a name="l00339"></a>00339
+<a name="l00340"></a>00340 <span class="preprocessor">#endif // SFML_HTTP_HPP</span>
+</pre></div></div>
+
<p id="footer">
&nbsp;::&nbsp; Copyright &copy; 2007-2008 Laurent Gomila, all rights reserved &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> &nbsp;::&nbsp;