36 virtual ~ascbinostream();
40 # define mDeclascbinostreamAddFns(typ) \ 41 ascbinostream& add(typ,char post=od_tab); \ 42 ascbinostream& add(typ,const char* post) 58 template <
class T,
class IT>
59 inline ascbinostream& addArr(
const T*,IT sz,
const char* between=
"\t",
60 const char* post=
"\n");
65 inline ascbinostream&
addBin(
const T& t )
66 {
return addBin( &t,
sizeof(T) ); }
87 virtual ~ascbinistream();
91 ascbinistream&
get(
char&);
92 ascbinistream&
get(
unsigned char&);
99 ascbinistream&
get(
float&);
100 ascbinistream&
get(
double&);
102 template <
class T,
class IT>
103 inline ascbinistream& getArr(T* arr,IT sz);
109 {
return getBin( &t,
sizeof(T) ); }
122 template <
class T,
class IT>
128 return addBin( &sz,
sizeof(IT) ).
addBin( arr, sz *
sizeof(T) );
131 for (
int idx=0; idx<sz; idx++ )
132 strm_ << arr[idx] << (idx == sz-1 ? post : between);
138 template <
class T,
class IT>
142 return getBin( arr, sz*
sizeof(T) );
144 for (
int idx=0; idx<sz; idx++ )
od_ostream & stream()
Definition: ascbinstream.h:68
#define mExpClass(module)
Definition: commondefs.h:160
ascbinostream & addEOL(T t)
Definition: ascbinstream.h:56
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
#define od_int64
Definition: plftypes.h:36
const bool binary_
Definition: ascbinstream.h:73
od_istream & strm_
Definition: ascbinstream.h:115
od_ostream & strm_
Definition: ascbinstream.h:72
const bool binary_
Definition: ascbinstream.h:116
const bool strmmine_
Definition: ascbinstream.h:74
ascbinostream & addArr(const T *, IT sz, const char *between="\t", const char *post="\n")
Will write both sz and the array.
Definition: ascbinstream.h:123
od_uint64 od_stream_Count
Definition: od_iosfwd.h:18
OD class for stream read.
Definition: od_istream.h:24
#define od_uint32
Definition: plftypes.h:32
reads from a stream that was created in ascbinostream style.
Definition: ascbinstream.h:81
#define mDeclascbinostreamAddFns(typ)
Definition: ascbinstream.h:40
ascbinistream & getBin(T &t)
Definition: ascbinstream.h:108
const bool strmmine_
Definition: ascbinstream.h:117
#define od_int16
Definition: plftypes.h:27
ascbinostream & addBin(const void *, od_stream_Count nrbytes)
#define od_uint64
Definition: plftypes.h:37
#define od_int32
Definition: plftypes.h:31
ascbinostream & addBin(const T &t)
Definition: ascbinstream.h:65
od_istream & stream()
Definition: ascbinstream.h:111
#define od_uint16
Definition: plftypes.h:28
ascbinistream & getArr(T *arr, IT sz)
Will NOT read the sz! Read sz and allocate first.
Definition: ascbinstream.h:139
writes to a stream that can be Ascii or Binary.
Definition: ascbinstream.h:30
#define od_newline
Definition: od_iosfwd.h:25