pocolog_cpp
Public Member Functions | List of all members
pocolog_cpp::FileStream Class Reference

#include <FileStream.hpp>

Public Member Functions

 FileStream ()
 
 FileStream (const char *__s, std::ios_base::openmode mode)
 
 ~FileStream ()
 
bool open (const char *fileName, std::ios_base::openmode mode)
 
void read (char *buffer, size_t size)
 
std::streampos tellg ()
 
std::streampos tellp ()
 
std::streampos seekg (std::streampos pos)
 
std::streampos seekp (std::streampos pos)
 
bool good () const
 
bool eof () const
 
bool fail () const
 
off_t size () const
 
void close ()
 

Detailed Description

Reimplementation of the std::fstream class.

This implementation is buffered, meanding that the class will keep a read and a writebuffer, and only perform disc accesses if neccessary.

This reimplementation performs way better in the usecase, that seekp/seekg is called often. The std::fstream implementation discards its buffer every time seek is called, resulting in a horrible runtime performance in our usecase.

Constructor & Destructor Documentation

◆ FileStream() [1/2]

pocolog_cpp::FileStream::FileStream ( )

◆ FileStream() [2/2]

pocolog_cpp::FileStream::FileStream ( const char *  __s,
std::ios_base::openmode  mode 
)

◆ ~FileStream()

pocolog_cpp::FileStream::~FileStream ( )

Member Function Documentation

◆ close()

void pocolog_cpp::FileStream::close ( )

◆ eof()

bool pocolog_cpp::FileStream::eof ( ) const
inline

◆ fail()

bool pocolog_cpp::FileStream::fail ( ) const

◆ good()

bool pocolog_cpp::FileStream::good ( ) const

◆ open()

bool pocolog_cpp::FileStream::open ( const char *  fileName,
std::ios_base::openmode  mode 
)

◆ read()

void pocolog_cpp::FileStream::read ( char *  buffer,
size_t  size 
)

◆ seekg()

std::streampos pocolog_cpp::FileStream::seekg ( std::streampos  pos)

◆ seekp()

std::streampos pocolog_cpp::FileStream::seekp ( std::streampos  pos)

◆ size()

off_t pocolog_cpp::FileStream::size ( ) const

◆ tellg()

std::streampos pocolog_cpp::FileStream::tellg ( )

◆ tellp()

std::streampos pocolog_cpp::FileStream::tellp ( )

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