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

Teddy::SysSupport::EndianIn Class Reference

Endian sensitive byte, short and float reading. More...

#include <EndianIn.h>

Inheritance diagram for Teddy::SysSupport::EndianIn:

Inheritance graph
[legend]
Collaboration diagram for Teddy::SysSupport::EndianIn:

Collaboration graph
[legend]
List of all members.

Public Methods

 EndianIn (const std::string &file_name=NULL)
 Constructor. More...

 ~EndianIn ()
 Destructor. More...

void open (const std::string &file_name)
 Same stream can be reused by closing and opening after constructor, too. More...

void close ()
 Close stream. More...

unsigned long len ()
 Get file length. More...

unsigned char read_byte ()
 Read in single byte from stream. More...

unsigned short read_short ()
 Read in two bytes and build short. More...

unsigned long read_long ()
 Read in four bytes and build long. More...

float read_float ()
 Read in four bytes and build float. More...

void read_all (char *buf)
 NOT ENDIAN INDEPENDENT. More...


Private Attributes

ifstream * ifs

Detailed Description

Endian sensitive byte, short and float reading.

A very very poor implementation for endian independent access to endian sensitive data,

Definition at line 43 of file EndianIn.h.


Constructor & Destructor Documentation

Teddy::SysSupport::EndianIn::EndianIn const std::string &    file_name = NULL
 

Constructor.

Definition at line 34 of file EndianIn.cpp.

References open.

Teddy::SysSupport::EndianIn::~EndianIn  
 

Destructor.

Definition at line 40 of file EndianIn.cpp.

References close.


Member Function Documentation

void Teddy::SysSupport::EndianIn::close  
 

Close stream.

Definition at line 65 of file EndianIn.cpp.

References ifs.

Referenced by ~EndianIn.

unsigned long Teddy::SysSupport::EndianIn::len  
 

Get file length.

Definition at line 76 of file EndianIn.cpp.

References ifs.

Referenced by read_all.

void Teddy::SysSupport::EndianIn::open const std::string &    file_name
 

Same stream can be reused by closing and opening after constructor, too.

Definition at line 46 of file EndianIn.cpp.

References ifs.

Referenced by EndianIn.

void Teddy::SysSupport::EndianIn::read_all char *    buf
 

NOT ENDIAN INDEPENDENT.

Definition at line 85 of file EndianIn.cpp.

References ifs, and len.

unsigned char Teddy::SysSupport::EndianIn::read_byte  
 

Read in single byte from stream.

Definition at line 91 of file EndianIn.cpp.

References ifs.

Referenced by read_float, read_long, and read_short.

float Teddy::SysSupport::EndianIn::read_float  
 

Read in four bytes and build float.

Definition at line 138 of file EndianIn.cpp.

References Teddy::SysSupport::EndianIO::q_MSBfirst, and read_byte.

unsigned long int Teddy::SysSupport::EndianIn::read_long  
 

Read in four bytes and build long.

Definition at line 121 of file EndianIn.cpp.

References Teddy::SysSupport::EndianIO::q_MSBfirst, and read_byte.

unsigned short int Teddy::SysSupport::EndianIn::read_short  
 

Read in two bytes and build short.

Definition at line 106 of file EndianIn.cpp.

References Teddy::SysSupport::EndianIO::q_MSBfirst, and read_byte.


Member Data Documentation

ifstream* Teddy::SysSupport::EndianIn::ifs [private]
 

Definition at line 44 of file EndianIn.h.

Referenced by close, len, open, read_all, and read_byte.


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