Qualia  0.2
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DiskXFile Class Reference

#include <DiskXFile.h>

Inheritance diagram for DiskXFile:
Inheritance graph
[legend]
Collaboration diagram for DiskXFile:
Collaboration graph
[legend]

Public Member Functions

 DiskXFile (const char *file_name, const char *open_flags)
 Open "file_name" with the flags #open_flags#. More...
 
 DiskXFile (FILE *file_)
 Use the given file... More...
 
virtual int read (void *ptr, int block_size, int n_blocks)
 
virtual int write (const void *ptr, int block_size, int n_blocks)
 
virtual int eof ()
 Are we at the end ? More...
 
virtual int flush ()
 Flush the file. More...
 
virtual int seek (long offset, int whence)
 Seek. More...
 
virtual long tell ()
 Tell me where am I... More...
 
virtual void rewind ()
 Rewind. More...
 
virtual int printf (const char *format,...)
 
virtual int scanf (const char *format, void *ptr)
 
virtual char * gets (char *dest, int size_)
 Print some text. More...
 
virtual ~DiskXFile ()
 
- Public Member Functions inherited from XFile
 XFile ()
 
int taggedRead (void *ptr, int block_size, int n_blocks, const char *tag)
 
int taggedWrite (const void *ptr, int block_size, int n_blocks, const char *tag)
 Write and write the tag/the size. More...
 
virtual long size ()
 
virtual ~XFile ()
 

Static Public Member Functions

static bool isLittleEndianProcessor ()
 Returns true# if the processor uses the little endian coding format. More...
 
static bool isBigEndianProcessor ()
 Returns true# if the processor uses the big endian coding format. More...
 
static bool isNativeMode ()
 Returns true# if we'll load/save using the native mode. More...
 
static void setNativeMode ()
 
static void setLittleEndianMode ()
 
static void setBigEndianMode ()
 

Public Attributes

FILE * file
 
bool is_opened
 
bool its_a_pipe
 

Private Member Functions

void reverseMemory (void *ptr_, int block_size, int n_blocks)
 

Private Attributes

char * buffer_block
 
int buffer_block_size
 

Static Private Attributes

static bool is_native_mode = true
 

Detailed Description

A file on the disk.

Author
Ronan Collobert (collo.nosp@m.ber@.nosp@m.idiap.nosp@m..ch)

Constructor & Destructor Documentation

DiskXFile::DiskXFile ( const char *  file_name,
const char *  open_flags 
)

Open "file_name" with the flags #open_flags#.

DiskXFile::DiskXFile ( FILE *  file_)

Use the given file...

DiskXFile::~DiskXFile ( )
virtual

Member Function Documentation

int DiskXFile::eof ( )
virtual

Are we at the end ?

Implements XFile.

int DiskXFile::flush ( )
virtual

Flush the file.

Implements XFile.

char * DiskXFile::gets ( char *  dest,
int  size_ 
)
virtual

Print some text.

Scan some text. Get one line (read at most #size_# characters).

Implements XFile.

bool DiskXFile::isBigEndianProcessor ( )
static

Returns true# if the processor uses the big endian coding format.

bool DiskXFile::isLittleEndianProcessor ( )
static

Returns true# if the processor uses the little endian coding format.

bool DiskXFile::isNativeMode ( )
static

Returns true# if we'll load/save using the native mode.

int DiskXFile::printf ( const char *  format,
  ... 
)
virtual
int DiskXFile::read ( void *  ptr,
int  block_size,
int  n_blocks 
)
virtual

Read something. Returns the number of blocks read or a value < 0 if there was an error.

Implements XFile.

void DiskXFile::reverseMemory ( void *  ptr_,
int  block_size,
int  n_blocks 
)
private
void DiskXFile::rewind ( )
virtual

Rewind.

Implements XFile.

int DiskXFile::scanf ( const char *  format,
void *  ptr 
)
virtual
int DiskXFile::seek ( long  offset,
int  whence 
)
virtual

Seek.

Implements XFile.

void DiskXFile::setBigEndianMode ( )
static

We'll load/save using big endian mode. It means that if the computer doesn't use Big Endian, data will be converted.

void DiskXFile::setLittleEndianMode ( )
static

We'll load/save using little endian mode. It means that if the computer doesn't use Little Endian, data will be converted.

void DiskXFile::setNativeMode ( )
static

We'll load/save using native mode. We use little endian iff the computer uses little endian. We use big endian iff the computer uses big endian.

long DiskXFile::tell ( )
virtual

Tell me where am I...

Implements XFile.

int DiskXFile::write ( const void *  ptr,
int  block_size,
int  n_blocks 
)
virtual

Write. Returns the number of blocks written or a value < 0 if there was an error.

Implements XFile.

Member Data Documentation

char* DiskXFile::buffer_block
private
int DiskXFile::buffer_block_size
private
FILE* DiskXFile::file
bool DiskXFile::is_native_mode = true
staticprivate
bool DiskXFile::is_opened
bool DiskXFile::its_a_pipe

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