FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
Classes | Public Member Functions | List of all members
FB::BrowserStream Class Referenceabstract

This is the abstract base class (interface class) for a browser stream. More...

#include "BrowserStream.h"

Inheritance diagram for FB::BrowserStream:
Inheritance graph
Collaboration diagram for FB::BrowserStream:
Collaboration graph

Classes

class  Range
 Specifies the range for a read range request (start to end) in bytes. More...
 

Public Member Functions

 BrowserStream (const std::string &url, bool cache, bool requestSeekable, size_t internalBufferSize)
 Default constructor. Dont't use directly, use BrowserHost::createStream instead. More...
 
virtual ~BrowserStream ()
 Destructor. More...
 
virtual bool readRange (size_t start, size_t end)
 Performs a read range request, returns the bytes in the range [start, end). More...
 
virtual bool readRanges (const std::vector< Range > &ranges)=0
 Same functionality as BrowserStream::readRange( size_t start, size_t end ), except multiple ranges can be requested at once. More...
 
virtual bool write (const char *data, size_t dataLength, size_t &written)=0
 Writes data to the stream. More...
 
virtual bool close ()=0
 Closes and destroys the stream. More...
 
virtual std::string getUrl () const
 Returns the url associated with this stream. This is the url supplied to. More...
 
virtual bool isSeekableByServer () const
 Returns true if the stream is actually seekable (server says so). More...
 
virtual bool isSeekableRequested () const
 Returns true if a stream was requested to be seekable. Not all servers support this. More...
 
virtual bool isSeekable () const
 Returns true if a stream was requested to be seekable and the server supports it. More...
 
virtual bool isCached () const
 Returns true if the content of this stream should be cached (i.e. a physical file must be created). More...
 
virtual bool isCompleted () const
 Returns true if download of this stream is completed (e.g. due to error or download finished). More...
 
virtual bool isOpen () const
 Returns true if the stream is open. More...
 
virtual std::string getMimeType () const
 Returns the mime type of this stream, e.g. "text/plain". More...
 
virtual std::wstring getCacheFilename () const
 If this is a cached stream, returns the physical filename of the file in the browser's cache. More...
 
virtual std::string getHeaders () const
 Returns the http headers. More...
 
virtual size_t getInternalBufferSize () const
 Returns the size of the internal buffer used by this stream. More...
 
virtual size_t getLength () const
 Returns the length of the stream in bytes (if server gives info like content-length). More...
 
- Public Member Functions inherited from FB::PluginEventSource
virtual void AttachObserver (PluginEventSink *sink)
 Attach a PluginEventSink to receive events. More...
 
virtual void DetachObserver (PluginEventSink *sink)
 Detach a PluginEventSink so it no longer receives events from this source. More...
 
virtual bool SendEvent (PluginEvent *evt)
 Sends an event to all attached sinks. More...
 
template<class T >
T * get_as ()
 Templated convenience function for performing a dynamic cast of this object. More...
 
template<class T >
bool validType ()
 Returns true if the object can be cast to the specified type. More...
 

Additional Inherited Members

- Protected Types inherited from FB::PluginEventSource
typedef std::list
< PluginEventSinkWeakPtr > 
ObserverMap
 Defines an alias representing the observer . More...
 
- Protected Attributes inherited from FB::PluginEventSource
boost::recursive_mutex m_observerLock
 List of attached observers. More...
 

Detailed Description

This is the abstract base class (interface class) for a browser stream.

A BrowserStream is used to download and upload data via the browser host. The different hosts (NPAPI, ActiveX) derive from this class and provide an implementation. Instances are created by the factory method BrowserHost::createStream( ... parameters ... ). BrowserStreams send various events when the stream is created, destroyed or data in response to a read request arrived.

Author
Matthias

Definition at line 41 of file BrowserStream.h.


The documentation for this class was generated from the following files: