ant
A2 ant: class-based analysis framework
ant::RawFileReader Class Reference

The RawFileReader class. More...

#include <RawFileReader.h>

Classes

class  Exception
 

Public Member Functions

virtual ~RawFileReader ()
 
double PercentDone () const
 
void open (const std::string &filename, const size_t inbufsize=BUFSIZ)
 open the given filename More...
 
 operator bool () const
 operator bool More...
 
void read (char *s, std::streamsize n)
 read n bytes to buffer s More...
 
void read (std::uint32_t *s, std::streamsize n)
 
std::streamsize gcount () const
 gcount More...
 
bool eof () const
 eof indicate end of file More...
 
void expand_buffer (std::vector< std::uint32_t > &buffer, size_t totalSize)
 
void reset ()
 reset file stream pointer More...
 

Detailed Description

The RawFileReader class.

Super-simple wrapper for reading binary files, even if they are compressed. Possible IO errors are propagated as exceptions

Constructor & Destructor Documentation

◆ ~RawFileReader()

ant::RawFileReader::~RawFileReader ( )
virtual

Member Function Documentation

◆ eof()

bool ant::RawFileReader::eof ( ) const
inline

eof indicate end of file

Returns
true if last read went beyond end of file.

Note that reading the exact number of bytes makes eof() stay false

◆ expand_buffer()

void ant::RawFileReader::expand_buffer ( std::vector< std::uint32_t > &  buffer,
size_t  totalSize 
)
inline

◆ gcount()

std::streamsize ant::RawFileReader::gcount ( ) const
inline

gcount

Returns
number of bytes read

◆ open()

void RawFileReader::open ( const std::string &  filename,
const size_t  inbufsize = BUFSIZ 
)

open the given filename

Parameters
filename
inbufsizeParameter inbufsize is ignored if non-compressed data is read

◆ operator bool()

ant::RawFileReader::operator bool ( ) const
inlineexplicit

operator bool

is false if the reader has a problem

◆ PercentDone()

double RawFileReader::PercentDone ( ) const

◆ read() [1/2]

void ant::RawFileReader::read ( char *  s,
std::streamsize  n 
)
inline

read n bytes to buffer s

Parameters
sbuffer (must be allocated by caller)
n

◆ read() [2/2]

void ant::RawFileReader::read ( std::uint32_t *  s,
std::streamsize  n 
)
inline

◆ reset()

void ant::RawFileReader::reset ( )
inline

reset file stream pointer

resets the pointer for a file stream to the beginning of the file in case of compressed files the decoder gets initialized again


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