ARTS 2.5.4 (git: 31ce4f0e)
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)
 
std::string readString (const char delim='\0')
 
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 43 of file bifstream.h.

Constructor & Destructor Documentation

◆ bifstream() [1/2]

bifstream::bifstream ( )
inline

Definition at line 45 of file bifstream.h.

◆ bifstream() [2/2]

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

Definition at line 47 of file bifstream.h.

References ARTS_USER_ERROR, and mfilep.

◆ ~bifstream()

bifstream::~bifstream ( )
inlinefinal

Definition at line 56 of file bifstream.h.

References mfilep.

Member Function Documentation

◆ getByte()

bifstream::Byte bifstream::getByte ( )
finalvirtual

Implements binistream.

Definition at line 61 of file bifstream.cc.

References binio::err, and Absorption::get().

◆ getRaw()

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

Definition at line 66 of file bifstream.h.

References ARTS_USER_ERROR_IF, c, mfilep, lm_hitran_2017::read(), and seek().

◆ pos()

streampos bifstream::pos ( )
finalvirtual

Implements binio.

Definition at line 53 of file bifstream.cc.

References binio::err.

◆ seek()

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

Implements binio.

Definition at line 34 of file bifstream.cc.

References Zeeman::end(), and binio::err.

Referenced by getRaw().

Member Data Documentation

◆ mfilep

FILE* bifstream::mfilep {nullptr}
private

Definition at line 78 of file bifstream.h.

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


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