00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020
00022
00031 #ifndef BOFSTREAM_H_INCLUDED
00032 #define BOFSTREAM_H_INCLUDED
00033
00034 #include <fstream>
00035
00036 #include "binio.h"
00037
00038
00040
00044 class bofstream : public binostream, public ofstream
00045 {
00046 public:
00047 bofstream () : ofstream () { }
00048
00049 explicit
00050 bofstream (const char* name,
00051 ios::openmode mode = ios::out | ios::trunc | ios::binary)
00052 : ofstream (name, mode)
00053 {
00054
00055 this->setFlag(binio::BigEndian, false);
00056 this->setFlag(binio::FloatIEEE);
00057 }
00058
00059 virtual ~bofstream () {}
00060 void seek(long spos, Offset offs);
00061 long pos();
00062
00063 void putByte (bofstream::Byte b);
00064 void putRaw (const char *c, streamsize n) { this->write (c, n); }
00065 };
00066
00067
00068
00069 bofstream& operator<< (bofstream& bof, double n);
00070
00071 bofstream& operator<< (bofstream& bof, float n);
00072
00073 bofstream& operator<< (bofstream& bof, long n);
00074
00075 bofstream& operator<< (bofstream& bof, int n);
00076
00077 #endif