Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

file_chunck Class Reference

file based chunck More...

#include <chunck.h>

Inheritance diagram for file_chunck:

Inheritance graph
[legend]
Collaboration diagram for file_chunck:

Collaboration graph
[legend]
List of all members.

Public Types

typedef unsigned int type
 type of a chunck (i.e. The first 4byte field of the chunck structure).


Public Methods

 file_chunck (const std::string &fname) throw (std::exception)
type get_type () const throw ()
 return the type of the chunck

unsigned int get_size () const throw ()
 return the size of the chunck

chuncksub_block () throw (std::exception)
 extract a subchunck from the current read position

bool eof () const throw ()
 is the chunck completely read ?

unsigned int tell () const throw ()
 get the chunck current read position

bool seek (int delta, std::ios::seekdir dir=std::ios::cur) throw (std::exception)
 move the current read position inside the chunck

bool read (void *buffer, unsigned int size) throw (std::exception)
 read some data for the current read position

char get_char () throw (std::exception)
 extract the character at the current read position

unsigned char get_byte () throw (std::exception)
 extract the byte at the current read position

short get_short () throw (std::exception)
 extract the short at the current read position

unsigned short get_word () throw (std::exception)
 extract the word at the current read position

unsigned int get_dword () throw (std::exception)
 extract the dword at the current read position


Static Public Methods

std::string chunck_string (type t)
 convert a type to a string


Protected Methods

 file_chunck () throw ()

Private Attributes

file_ptr_data
type _type
unsigned int _size
unsigned int _offset
unsigned int _cur_pos

Detailed Description

file based chunck

This class is an implementation of chunck that handles file.

Definition at line 71 of file chunck.h.


Member Typedef Documentation

typedef unsigned int chunck::type [inherited]
 

type of a chunck (i.e. The first 4byte field of the chunck structure).

Definition at line 39 of file chunck.h.

Referenced by imuse_channel::append_data(), saud_channel::append_data(), player::checkBlock(), chunck::chunck_string(), get_strings(), cont_chunck::get_type(), get_type(), imuse_channel::processBuffer(), saud_channel::processBuffer(), and cont_chunck::sub_block().


Constructor & Destructor Documentation

file_chunck::file_chunck   throw () [protected]
 

Definition at line 67 of file chunck.cpp.

file_chunck::file_chunck const std::string &    fname throw (std::exception)
 

Definition at line 73 of file chunck.cpp.

References from_big_endian().


Member Function Documentation

string chunck::chunck_string type    t [static, inherited]
 

convert a type to a string

Utility function that convert a type to a string.

Parameters:
t  the type to convert to a string
Returns:
the converted string

Definition at line 56 of file chunck.cpp.

References chunck::type.

Referenced by player::handleFrame(), imuse_channel::handleMap(), imuse_channel::processBuffer(), and saud_channel::processBuffer().

bool file_chunck::eof   const throw () [virtual]
 

is the chunck completely read ?

Implements chunck.

Definition at line 116 of file chunck.cpp.

Referenced by player::play().

unsigned char file_chunck::get_byte   throw (std::exception) [virtual]
 

extract the byte at the current read position

Implements chunck.

Definition at line 163 of file chunck.cpp.

char file_chunck::get_char   throw (std::exception) [virtual]
 

extract the character at the current read position

Implements chunck.

Definition at line 154 of file chunck.cpp.

unsigned int file_chunck::get_dword   throw (std::exception) [virtual]
 

extract the dword at the current read position

Implements chunck.

Definition at line 190 of file chunck.cpp.

short file_chunck::get_short   throw (std::exception) [virtual]
 

extract the short at the current read position

Implements chunck.

Definition at line 172 of file chunck.cpp.

unsigned int file_chunck::get_size   const throw () [virtual]
 

return the size of the chunck

Implements chunck.

Definition at line 96 of file chunck.cpp.

Referenced by sub_block().

chunck::type file_chunck::get_type   const throw () [virtual]
 

return the type of the chunck

Implements chunck.

Definition at line 92 of file chunck.cpp.

References chunck::type.

unsigned short file_chunck::get_word   throw (std::exception) [virtual]
 

extract the word at the current read position

Implements chunck.

Definition at line 181 of file chunck.cpp.

bool file_chunck::read void *    buffer,
unsigned int    size
throw (std::exception) [virtual]
 

read some data for the current read position

Implements chunck.

Definition at line 146 of file chunck.cpp.

bool file_chunck::seek int    delta,
std::ios::seekdir    dir = std::ios::cur
throw (std::exception) [virtual]
 

move the current read position inside the chunck

Implements chunck.

Definition at line 124 of file chunck.cpp.

chunck * file_chunck::sub_block   throw (std::exception) [virtual]
 

extract a subchunck from the current read position

Implements chunck.

Definition at line 100 of file chunck.cpp.

References _cur_pos, _data, _offset, _size, _type, from_big_endian(), get_size(), and file_ptr::seek().

Referenced by player::play().

unsigned int file_chunck::tell   const throw () [virtual]
 

get the chunck current read position

Implements chunck.

Definition at line 120 of file chunck.cpp.


Member Data Documentation

unsigned int file_chunck::_cur_pos [private]
 

Definition at line 77 of file chunck.h.

Referenced by sub_block().

file_ptr* file_chunck::_data [private]
 

Definition at line 73 of file chunck.h.

Referenced by sub_block().

unsigned int file_chunck::_offset [private]
 

Definition at line 76 of file chunck.h.

Referenced by sub_block().

unsigned int file_chunck::_size [private]
 

Definition at line 75 of file chunck.h.

Referenced by sub_block().

type file_chunck::_type [private]
 

Definition at line 74 of file chunck.h.

Referenced by sub_block().


The documentation for this class was generated from the following files:
Generated on Fri Aug 9 22:54:32 2002 for san_player by doxygen1.2.16