Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NETWORK_ADAPTER_H
00021 #define NETWORK_ADAPTER_H
00022
00023 #include "dsodefs.h"
00024
00025 #include <map>
00026 #include <string>
00027 #include <memory>
00028 #include <set>
00029 #include "StringPredicates.h"
00030
00031 namespace gnash {
00032 class IOChannel;
00033
00035 class NetworkAdapter {
00036
00037 public:
00038
00042 typedef std::map<std::string, std::string, StringNoCaseLessThan>
00043 RequestHeaders;
00044
00048
00050 DSOEXPORT static std::auto_ptr<IOChannel> makeStream(
00051 const std::string& url, const std::string& cachefile);
00052
00056
00061 DSOEXPORT static std::auto_ptr<IOChannel> makeStream(
00062 const std::string& url, const std::string& postdata,
00063 const std::string& cachefile);
00064
00068
00074 DSOEXPORT static std::auto_ptr<IOChannel> makeStream(const std::string& url,
00075 const std::string& postdata, const RequestHeaders& headers,
00076 const std::string& cachefile);
00077
00078
00079 typedef std::set<std::string, StringNoCaseLessThan> ReservedNames;
00080
00082
00086 DSOEXPORT static bool isHeaderAllowed(const std::string& headerName)
00087 {
00088 const ReservedNames& names = reservedNames();
00089 return (names.find(headerName) == names.end());
00090 }
00091
00092 private:
00093
00094 static const ReservedNames& reservedNames();
00095
00096 };
00097
00098 }
00099
00100 #endif // CURL_ADAPTER_H
00101
00102
00103
00104
00105