00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef STREAMWRITER_H
00020 #define STREAMWRITER_H
00021
00022 #include "pandabase.h"
00023
00024 #include "numeric_types.h"
00025 #include "littleEndian.h"
00026 #include "bigEndian.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDAEXPRESS StreamWriter {
00038 public:
00039 INLINE StreamWriter(ostream &out);
00040 PUBLISHED:
00041 INLINE StreamWriter(ostream *out);
00042 INLINE StreamWriter(const StreamWriter ©);
00043 INLINE void operator = (const StreamWriter ©);
00044 INLINE ~StreamWriter();
00045
00046 INLINE ostream *get_ostream() const;
00047
00048 INLINE void add_bool(bool value);
00049 INLINE void add_int8(PN_int8 value);
00050 INLINE void add_uint8(PN_uint8 value);
00051
00052
00053 INLINE void add_int16(PN_int16 value);
00054 INLINE void add_int32(PN_int32 value);
00055 INLINE void add_int64(PN_int64 value);
00056 INLINE void add_uint16(PN_uint16 value);
00057 INLINE void add_uint32(PN_uint32 value);
00058 INLINE void add_uint64(PN_uint64 value);
00059 INLINE void add_float32(float value);
00060 INLINE void add_float64(PN_float64 value);
00061
00062
00063 INLINE void add_be_int16(PN_int16 value);
00064 INLINE void add_be_int32(PN_int32 value);
00065 INLINE void add_be_int64(PN_int64 value);
00066 INLINE void add_be_uint16(PN_uint16 value);
00067 INLINE void add_be_uint32(PN_uint32 value);
00068 INLINE void add_be_uint64(PN_uint64 value);
00069 INLINE void add_be_float32(float value);
00070 INLINE void add_be_float64(PN_float64 value);
00071
00072 INLINE void add_string(const string &str);
00073 INLINE void add_z_string(string str);
00074 INLINE void add_fixed_string(const string &str, size_t size);
00075
00076 void pad_bytes(size_t size);
00077 INLINE void append_data(const void *data, size_t size);
00078 INLINE void append_data(const string &data);
00079
00080 private:
00081 ostream *_out;
00082 };
00083
00084 #include "streamWriter.I"
00085
00086 #endif