BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Public Member Functions
btk::NativeBinaryFileStream Class Reference

Native binary file stream chosen by the used compiler. More...

#include <btkBinaryFileStream.h>

Inheritance diagram for btk::NativeBinaryFileStream:
Inheritance graph
[legend]

Public Member Functions

 NativeBinaryFileStream ()
 
 NativeBinaryFileStream (const std::string &filename, OpenMode mode)
 
- Public Member Functions inherited from btk::BinaryFileStream
bool Bad () const
 
void Clear (IOState flags=GoodBit)
 
void Close ()
 
bool EndFile () const
 
bool Fail () const
 
size_t Fill (size_t nb)
 
IOState GetExceptions ()
 
const RawFileStreamGetStream () const
 
bool Good () const
 
bool IsOpen () const
 
void Open (const std::string &filename, OpenMode mode)
 
char ReadChar ()
 
void ReadChar (size_t nb, char *values)
 
void ReadChar (std::vector< char > &values)
 
std::vector< char > ReadChar (size_t nb)
 
virtual double ReadDouble ()=0
 
void ReadDouble (size_t nb, double *values)
 
void ReadDouble (std::vector< double > &values)
 
std::vector< double > ReadDouble (size_t nb)
 
virtual float ReadFloat ()=0
 
void ReadFloat (size_t nb, float *values)
 
void ReadFloat (std::vector< float > &values)
 
std::vector< float > ReadFloat (size_t nb)
 
virtual int16_t ReadI16 ()=0
 
void ReadI16 (size_t nb, int16_t *values)
 
void ReadI16 (std::vector< int16_t > &values)
 
std::vector< int16_t > ReadI16 (size_t nb)
 
virtual int32_t ReadI32 ()=0
 
void ReadI32 (size_t nb, int32_t *values)
 
void ReadI32 (std::vector< int32_t > &values)
 
std::vector< int32_t > ReadI32 (size_t nb)
 
int8_t ReadI8 ()
 
void ReadI8 (size_t nb, int8_t *values)
 
void ReadI8 (std::vector< int8_t > &values)
 
std::vector< int8_t > ReadI8 (size_t nb)
 
std::string ReadString (size_t nbChar)
 
void ReadString (size_t nb, size_t nbChar, std::string *values)
 
void ReadString (size_t nbChar, std::vector< std::string > &values)
 
std::vector< std::string > ReadString (size_t nb, size_t nbChar)
 
virtual uint16_t ReadU16 ()=0
 
void ReadU16 (size_t nb, uint16_t *values)
 
void ReadU16 (std::vector< uint16_t > &values)
 
std::vector< uint16_t > ReadU16 (size_t nb)
 
virtual uint32_t ReadU32 ()=0
 
void ReadU32 (size_t nb, uint32_t *values)
 
void ReadU32 (std::vector< uint32_t > &values)
 
std::vector< uint32_t > ReadU32 (size_t nb)
 
uint8_t ReadU8 ()
 
void ReadU8 (size_t nb, uint8_t *values)
 
void ReadU8 (std::vector< uint8_t > &values)
 
std::vector< uint8_t > ReadU8 (size_t nb)
 
void SeekRead (StreamOffset offset, SeekDir dir)
 
void SeekWrite (StreamOffset offset, SeekDir dir)
 
void SetExceptions (IOState except)
 
void SwapStream (BinaryFileStream *toSwap)
 
StreamPosition TellRead () const
 
size_t Write (int8_t i8)
 
size_t Write (const std::vector< int8_t > &rVectorI8)
 
size_t Write (uint8_t u8)
 
size_t Write (const std::vector< uint8_t > &rVectorU8)
 
virtual size_t Write (int16_t i16)=0
 
size_t Write (const std::vector< int16_t > &rVectorI16)
 
virtual size_t Write (uint16_t u16)=0
 
size_t Write (const std::vector< uint16_t > &rVectorU16)
 
virtual size_t Write (int32_t i32)=0
 
size_t Write (const std::vector< int32_t > &rVectorI32)
 
virtual size_t Write (uint32_t u32)=0
 
size_t Write (const std::vector< uint32_t > &rVectorU32)
 
virtual size_t Write (float f)=0
 
size_t Write (const std::vector< float > &rVectorFloat)
 
size_t Write (const std::string &rString)
 
size_t Write (const std::vector< std::string > &rVectorString)
 
virtual ~BinaryFileStream ()
 

Additional Inherited Members

- Public Types inherited from btk::BinaryFileStream
typedef std::ios_base::iostate IOState
 
typedef std::ios_base::openmode OpenMode
 
typedef std::ios_base::seekdir SeekDir
 
typedef std::streamoff StreamOffset
 
typedef std::streampos StreamPosition
 
- Static Public Attributes inherited from btk::BinaryFileStream
static const IOState BadBit = std::ios_base::badbit
 
static const SeekDir Begin = std::ios_base::beg
 
static const SeekDir Current = std::ios_base::cur
 
static const SeekDir End = std::ios_base::end
 
static const IOState EndFileBit = std::ios_base::eofbit
 
static const IOState FailBit = std::ios_base::failbit
 
static const IOState GoodBit = std::ios_base::goodbit
 
static const OpenMode In = std::ios_base::in
 
static const OpenMode Out = std::ios_base::out
 
static const OpenMode Truncate = std::ios_base::trunc
 
- Protected Member Functions inherited from btk::BinaryFileStream
 BinaryFileStream ()
 
 BinaryFileStream (const std::string &filename, OpenMode mode)
 
- Protected Attributes inherited from btk::BinaryFileStream
RawFileStreammp_Stream
 

Detailed Description

Native binary file stream chosen by the used compiler.

Depending the processor, the native binary file stream will be:

See Also
BinaryFileStream, VAXLittleEndianBinaryFileStream, IEEELittleEndianBinaryFileStream, IEEEBigEndianBinaryFileStream

Constructor & Destructor Documentation

btk::NativeBinaryFileStream::NativeBinaryFileStream ( )
inline

Default constructor. Use the method NativeBinaryFileStream::Open to associate a physical file.

btk::NativeBinaryFileStream::NativeBinaryFileStream ( const std::string &  filename,
OpenMode  mode 
)
inline

Associates the file with the filename filename using the option mode to this object.

If the opening is not successfull, then the FailBit is set. You can check its state by using the method Fail().