Gnash  0.8.10
Public Member Functions
gnash::SWFParser Class Reference

The SWFParser parses tags from a SWFStream. More...

#include <SWFParser.h>

List of all members.

Public Member Functions

 SWFParser (SWFStream &in, movie_definition *md, const RunResources &runResources)
size_t bytesRead () const
 The number of bytes processed by this SWFParser.
bool read (std::streamsize bytes)
 Parse a specified number of bytes from the stream.

Detailed Description

The SWFParser parses tags from a SWFStream.

The definitions created from the tags are added to one of the higher-level definition types: either a sprite_definition or a SWFMovieDefinition. SWFParser's interface deals only with the size of data it has to read, or the number of bytes read. It does not expose the absolute stream position. This is intended to make internal refactoring simpler. Users must tell the SWFParser how many bytes it should read from the stream. The SWFParser will only deal with ParserExceptions in an open tag. Exceptions thrown when opening and closing tags signal a fatal error, and will be left to the callers to deal with.


Constructor & Destructor Documentation

gnash::SWFParser::SWFParser ( SWFStream in,
movie_definition md,
const RunResources runResources 
) [inline]

Member Function Documentation

size_t gnash::SWFParser::bytesRead ( ) const [inline]

The number of bytes processed by this SWFParser.

bool gnash::SWFParser::read ( std::streamsize  bytes)

Parse a specified number of bytes from the stream.

This function will read as many complete tags as are in the specified number of bytes. Any incomplete tags will be left open and unparsed until the next call to read().

Parameters:
bytesThe number of bytes to read. Callers must ensure this is not past the end of the stream, or this function may never return.
Returns:
False if the end of a SWF is reached during parsing. This can be mean that a SWF::END tag appears before the end of the bytes to parse.

References gnash::key::SWF, gnash::RunResources::tagLoaders(), startPos, gnash::SWFStream::tell(), gnash::SWF::END, gnash::SWF::SHOWFRAME, IF_VERBOSE_PARSE, _, gnash::movie_definition::incrementLoadedFrames(), gnash::SWF::TagLoadersTable::get(), and gnash::key::e.


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