Public Member Functions

gnash::tu_file Class Reference

#include <tu_file.h>

Inheritance diagram for gnash::tu_file:
Inheritance graph
[legend]
Collaboration diagram for gnash::tu_file:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tu_file (FILE *fp, bool autoclose)
 ~tu_file ()
boost::uint32_t read_le32 ()
 Read a 32-bit word from a little-endian stream. returning it as a native-endian word.
boost::uint16_t read_le16 ()
 Read a 16-bit word from a little-endian stream.
boost::uint8_t read_byte ()
 Read a single byte from the stream.
std::streamsize read (void *dst, std::streamsize num)
 Read the given number of bytes from the stream.
std::streamsize write (const void *src, std::streamsize num)
 Write the given number of bytes to the stream.
std::streampos tell () const
 Return current stream position.
bool seek (std::streampos p)
 Seek to the specified position.
void go_to_end ()
 Seek to the end of the stream.
bool eof () const
 Return true if the end of the stream has been reached.
bool bad () const
 Return non-zero if the stream is in an error state.
size_t size () const
 Get the size of the stream.

Constructor & Destructor Documentation

gnash::tu_file::tu_file ( FILE *  fp,
bool  autoclose = false 
)
gnash::tu_file::~tu_file (  ) 

Member Function Documentation

bool gnash::tu_file::bad (  )  const [virtual]

Return non-zero if the stream is in an error state.

When the stream is in an error state there's nothing you can do about it, just delete it and log the error.

There are some rough meaning for possible returned values but I don't think they make much sense currently.

Implements gnash::IOChannel.

bool gnash::tu_file::eof (  )  const [virtual]

Return true if the end of the stream has been reached.

TODO: define what to return when in error condition see bad().

Implements gnash::IOChannel.

void gnash::tu_file::go_to_end (  )  [virtual]

Seek to the end of the stream.

TODO: define what happens when an error occurs

Implements gnash::IOChannel.

std::streamsize gnash::tu_file::read ( void *  dst,
std::streamsize  num 
) [virtual]

Read the given number of bytes from the stream.

TODO: define what happens when the stream is in error condition, see bad().

Implements gnash::IOChannel.

boost::uint8_t gnash::tu_file::read_byte (  )  [inline]

Read a single byte from the stream.

TODO: define what happens when the stream is in error condition, see bad().

Reimplemented from gnash::IOChannel.

boost::uint16_t gnash::tu_file::read_le16 (  )  [inline]

Read a 16-bit word from a little-endian stream.

TODO: define what happens when the stream is in error condition, see bad().

Reimplemented from gnash::IOChannel.

boost::uint32_t gnash::tu_file::read_le32 (  )  [inline]

Read a 32-bit word from a little-endian stream. returning it as a native-endian word.

TODO: define what happens when the stream is in error condition.

Reimplemented from gnash::IOChannel.

bool gnash::tu_file::seek ( std::streampos  p  )  [virtual]

Seek to the specified position.

TODO: define what happens when an error occurs, or when we're already in an error condition

Returns:
true on success, or false on failure.

Implements gnash::IOChannel.

size_t gnash::tu_file::size (  )  const [virtual]

Get the size of the stream.

Reimplemented from gnash::IOChannel.

std::streampos gnash::tu_file::tell (  )  const [virtual]

Return current stream position.

TODO: define what to return when the stream is in error condition, see bad().

Implements gnash::IOChannel.

References s.

std::streamsize gnash::tu_file::write ( const void *  src,
std::streamsize  num 
) [virtual]

Write the given number of bytes to the stream.

TODO: define what happens when the stream is in error condition, see bad().

Reimplemented from gnash::IOChannel.


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