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 #ifndef GNASH_STREAMPROVIDER_H
00020 #define GNASH_STREAMPROVIDER_H
00021
00022 #include "NetworkAdapter.h"
00023 #include "dsodefs.h"
00024 #include "NamingPolicy.h"
00025
00026 #include <string>
00027 #include <memory>
00028
00029
00030 namespace gnash {
00031 class URL;
00032 class IOChannel;
00033 }
00034
00035
00036 namespace gnash {
00037
00039
00047
00049 class DSOEXPORT StreamProvider
00050 {
00051 public:
00052
00054
00059 StreamProvider(const URL& original, const URL& base,
00060 std::auto_ptr<NamingPolicy> np =
00061 std::auto_ptr<NamingPolicy>(new NamingPolicy));
00062
00063 virtual ~StreamProvider() {}
00064
00066
00069 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00070 bool namedCacheFile = false) const;
00071
00073
00081 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00082 const std::string& postdata, bool namedCacheFile = false) const;
00083
00084 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00085 const std::string& postdata,
00086 const NetworkAdapter::RequestHeaders& headers,
00087 bool namedCacheFile = false) const;
00088
00090
00093 void setNamingPolicy(std::auto_ptr<NamingPolicy> np) {
00094 _namingPolicy = np;
00095 }
00096
00098 const NamingPolicy& namingPolicy() const {
00099 assert(_namingPolicy.get());
00100 return *_namingPolicy;
00101 }
00102
00104
00108
00111 bool allow(const URL& url) const;
00112
00114
00117 const URL& baseURL() const {
00118 return _base;
00119 }
00120
00121 private:
00122
00124 std::auto_ptr<NamingPolicy> _namingPolicy;
00125
00126 const URL _base;
00127
00128 const URL _original;
00129
00130 };
00131
00132 }
00133
00134 #endif
00135
00136
00137
00138
00139
00140