ARTS  2.2.66
bofstream Class Reference

Binary output file stream class. More...

#include <bofstream.h>

Inheritance diagram for bofstream:
Collaboration diagram for bofstream:

Public Member Functions

 bofstream ()
 
 bofstream (const char *name, ios::openmode mode=ios::out|ios::trunc|ios::binary)
 
virtual ~bofstream ()
 
void seek (long spos, Offset offs)
 
streampos pos ()
 
void putByte (bofstream::Byte b)
 
void putRaw (const char *c, streamsize n)
 
- Public Member Functions inherited from binostream
 binostream ()
 
virtual ~binostream ()
 
void writeInt (Int val, unsigned int size)
 
void writeFloat (Float f, FType ft)
 
unsigned long writeString (const char *str, unsigned long amount=0)
 
unsigned long writeString (const std::string &str)
 
- Public Member Functions inherited from binio
 binio ()
 
virtual ~binio ()
 
void setFlag (Flag f, bool set=true)
 
bool getFlag (Flag f)
 
Error error ()
 
bool eof ()
 

Additional Inherited Members

- Public Types inherited from binio
enum  Flag { BigEndian = 1 << 0, FloatIEEE = 1 << 1 }
 
enum  ErrorCode {
  NoError = 0, Fatal = 1 << 0, Unsupported = 1 << 1, NotOpen = 1 << 2,
  Denied = 1 << 3, NotFound = 1 << 4, Eof = 1 << 5
}
 
enum  Offset { Set, Add, End }
 
enum  FType { Single, Double }
 
typedef int Error
 
- Protected Types inherited from binio
typedef long Int
 
typedef double Float
 
typedef unsigned char Byte
 
typedef int Flags
 
- Protected Attributes inherited from binio
Flags my_flags
 
Error err
 
- 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 44 of file bofstream.h.

Constructor & Destructor Documentation

◆ bofstream() [1/2]

bofstream::bofstream ( )
inline

Definition at line 47 of file bofstream.h.

◆ bofstream() [2/2]

bofstream::bofstream ( const char *  name,
ios::openmode  mode = ios::out | ios::trunc | ios::binary 
)
inlineexplicit

Definition at line 50 of file bofstream.h.

References binio::BigEndian, binio::FloatIEEE, and binio::setFlag().

◆ ~bofstream()

virtual bofstream::~bofstream ( )
inlinevirtual

Definition at line 59 of file bofstream.h.

References pos(), putByte(), and seek().

Member Function Documentation

◆ pos()

streampos bofstream::pos ( )
virtual

Implements binio.

Definition at line 46 of file bofstream.cc.

References binio::err, and binio::NotOpen.

Referenced by ~bofstream().

◆ putByte()

void bofstream::putByte ( bofstream::Byte  b)
virtual

Implements binostream.

Definition at line 52 of file bofstream.cc.

References binio::err, binio::Fatal, and binio::NotOpen.

Referenced by ~bofstream().

◆ putRaw()

void bofstream::putRaw ( const char *  c,
streamsize  n 
)
inlinevirtual

Implements binostream.

Definition at line 64 of file bofstream.h.

References operator<<().

◆ seek()

void bofstream::seek ( long  spos,
Offset  offs 
)
virtual

Implements binio.

Definition at line 35 of file bofstream.cc.

References binio::Add, binio::End, binio::err, binio::NotOpen, and binio::Set.

Referenced by ~bofstream().


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