ARTS 2.5.11 (git: 6827797f)
bifstream Class Referencefinal

Binary output file stream class. More...

#include <bifstream.h>

Inheritance diagram for bifstream:
binistream binio

Public Member Functions

 bifstream ()
 
 bifstream (const char *name, ios::openmode mode=ios::in|ios::binary)
 
 ~bifstream () final
 
void seek (long spos, Offset offs) final
 
streampos pos () final
 
bifstream::Byte getByte () final
 
void getRaw (char *c, streamsize n) final
 
- Public Member Functions inherited from binistream
Int readInt (unsigned int size)
 
Float readFloat (FType ft)
 
void readDoubleArray (double *d, unsigned long size)
 
unsigned long readString (char *str, unsigned long amount)
 
unsigned long readString (char *str, unsigned long maxlen, const char delim)
 
Int peekInt (unsigned int size)
 
Float peekFloat (FType ft)
 
bool ateof ()
 
void ignore (unsigned long amount=1)
 
- Public Member Functions inherited from binio
 binio ()
 
void setFlag (Flag f, bool set=true)
 
bool getFlag (Flag f)
 
Error error ()
 
bool eof ()
 
virtual void seek (long, Offset=Set)=0
 
virtual std::streampos pos ()=0
 

Private Attributes

FILE * mfilep {nullptr}
 

Additional Inherited Members

- Public Types inherited from binio
using Flag = enum { BigEndian=1<< 0, FloatIEEE=1<< 1 }
 
using ErrorCode = enum { NoError=0, Fatal=1<< 0, Unsupported=1<< 1, NotOpen=1<< 2, Denied=1<< 3, NotFound=1<< 4, Eof=1<< 5 }
 
using Offset = enum { Set, Add, End }
 
using FType = enum { Single, Double }
 
using Error = int
 
- Protected Types inherited from binio
using Int = std::int64_t
 
using Float = double
 
using Byte = unsigned char
 
using Flags = int
 
- Protected Member Functions inherited from binistream
virtual Byte getByte ()=0
 
virtual void getRaw (char *c, std::streamsize n)=0
 
- Protected Attributes inherited from binio
Flags my_flags {system_flags}
 
Error err {NoError}
 
- Static Protected Attributes inherited from binio
static const Flags system_flags = binio::detect_system_flags()
 

Detailed Description

Binary output file stream class.

Handles writing to an output file stream in binary format. It makes it possible to use the operator<< for binary output.

Definition at line 26 of file bifstream.h.

Constructor & Destructor Documentation

◆ bifstream() [1/2]

bifstream::bifstream ( )
inline

Definition at line 28 of file bifstream.h.

◆ bifstream() [2/2]

bifstream::bifstream ( const char *  name,
ios::openmode  mode = ios::in | ios::binary 
)
inlineexplicit

Definition at line 30 of file bifstream.h.

References ARTS_USER_ERROR, and mfilep.

◆ ~bifstream()

bifstream::~bifstream ( )
inlinefinal

Definition at line 39 of file bifstream.h.

References mfilep.

Member Function Documentation

◆ getByte()

bifstream::Byte bifstream::getByte ( )
finalvirtual

Implements binistream.

Definition at line 44 of file bifstream.cc.

References binio::err.

◆ getRaw()

void bifstream::getRaw ( char *  c,
streamsize  n 
)
inlinefinal

Definition at line 49 of file bifstream.h.

References ARTS_USER_ERROR_IF, c, mfilep, and seek().

◆ pos()

streampos bifstream::pos ( )
finalvirtual

Implements binio.

Definition at line 36 of file bifstream.cc.

References binio::err.

◆ seek()

void bifstream::seek ( long  spos,
Offset  offs 
)
finalvirtual

Implements binio.

Definition at line 17 of file bifstream.cc.

References binio::err.

Referenced by getRaw().

Member Data Documentation

◆ mfilep

FILE* bifstream::mfilep {nullptr}
private

Definition at line 61 of file bifstream.h.

Referenced by bifstream(), getRaw(), and ~bifstream().


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