ARTS 2.5.11 (git: 6827797f)
bofstream.h
Go to the documentation of this file.
1
2// File description
4
13#ifndef BOFSTREAM_H_INCLUDED
14#define BOFSTREAM_H_INCLUDED
15
16#include <fstream>
17
18#include "binio.h"
19
21
25class bofstream : public binostream, public ofstream {
26 public:
27 bofstream() : ofstream() {}
28
29 explicit bofstream(const char* name,
30 ios::openmode mode = ios::out | ios::trunc | ios::binary)
31 : ofstream(name, mode) {}
32
33 void seek(long spos, Offset offs) override final;
34 streampos pos() override final;
35
36 void putByte(bofstream::Byte b) override final;
37 void putRaw(const char* c, streamsize n) override final { this->write(c, n); }
38};
39
40/* Overloaded output operators */
41bofstream& operator<<(bofstream& bof, double n);
42
43bofstream& operator<<(bofstream& bof, float n);
44
45bofstream& operator<<(bofstream& bof, std::int64_t n);
46
47bofstream& operator<<(bofstream& bof, int n);
48
49#endif
bofstream & operator<<(bofstream &bof, double n)
Definition: bofstream.cc:59
enum { Set, Add, End } Offset
Definition: binio.h:64
unsigned char Byte
Definition: binio.h:82
Binary output file stream class.
Definition: bofstream.h:25
streampos pos() override final
Definition: bofstream.cc:36
void putByte(bofstream::Byte b) override final
Definition: bofstream.cc:44
void seek(long spos, Offset offs) override final
Definition: bofstream.cc:17
bofstream(const char *name, ios::openmode mode=ios::out|ios::trunc|ios::binary)
Definition: bofstream.h:29
bofstream()
Definition: bofstream.h:27
void putRaw(const char *c, streamsize n) override final
Definition: bofstream.h:37
#define c
#define b