• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

StreamProvider.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #ifndef GNASH_STREAMPROVIDER_H
00020 #define GNASH_STREAMPROVIDER_H
00021 
00022 #include "NetworkAdapter.h"
00023 #include "dsodefs.h" // for DSOEXPORT
00024 #include "NamingPolicy.h"
00025 
00026 #include <string>
00027 #include <memory>
00028 
00029 // Forward declarations
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 } // namespace gnash
00103 
00104 #endif 
00105 
00106 
00107 // Local Variables:
00108 // mode: C++
00109 // indent-tabs-mode: t
00110 // End:

Generated on Thu Sep 30 2010 14:35:03 for Gnash by  doxygen 1.7.1