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 class DSOEXPORT StreamProvider
00040 {
00041
00042 public:
00043
00044 StreamProvider(std::auto_ptr<NamingPolicy> =
00045 std::auto_ptr<NamingPolicy>(new NamingPolicy));
00046
00047 virtual ~StreamProvider() {}
00048
00050
00054 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00055 bool namedCacheFile = false) const;
00056
00058
00071 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00072 const std::string& postdata, bool namedCacheFile = false) const;
00073
00074 virtual std::auto_ptr<IOChannel> getStream(const URL& url,
00075 const std::string& postdata,
00076 const NetworkAdapter::RequestHeaders& headers,
00077 bool namedCacheFile = false) const;
00078
00080
00083 void setNamingPolicy(std::auto_ptr<NamingPolicy> np)
00084 {
00085 _namingPolicy = np;
00086 }
00087
00089 const NamingPolicy& namingPolicy() const
00090 {
00091 assert(_namingPolicy.get());
00092 return *_namingPolicy;
00093 }
00094
00095 private:
00096
00098 std::auto_ptr<NamingPolicy> _namingPolicy;
00099
00100 };
00101
00102 }
00103
00104 #endif
00105
00106
00107
00108
00109
00110