29 #ifndef HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
30 #define HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
33 #include "BlockingStream.h"
43 namespace hu {
namespace varadiistvan {
namespace scpl {
namespace io {
76 template <
typename T> T
readT(T defaultValue = 0);
153 size_t readString(
char* dest,
size_t capacity);
252 T value = defaultValue;
253 read(&value,
sizeof(value));
261 return readT<int8_t>(0);
268 return readT<uint8_t>(0);
275 return readT<int16_t>(0);
282 return readT<uint16_t>(0);
289 return readT<int32_t>(0);
296 return readT<uint32_t>(0);
303 return readT<int64_t>(0);
310 return readT<uint64_t>(0);
317 return readT<float>(0.0);
324 return readT<double>(0.0);
331 return readT<long double>(0.0);
338 return write(&x,
sizeof(x));
345 return write(&x,
sizeof(x));
352 return write(&x,
sizeof(x));
359 return write(&x,
sizeof(x));
366 return write(&x,
sizeof(x));
373 return write(&x,
sizeof(x));
380 return write(&x,
sizeof(x));
387 return write(&x,
sizeof(x));
394 return write(&x,
sizeof(x));
401 return write(&x,
sizeof(x));
408 return write(&x,
sizeof(x));
416 else return write(s, length);
bool write(const void *src, size_t length)
bool read(void *dest, size_t length)
bool writeDouble(double x)
DataStream(BufferedStream &stream)
bool writeString(const char *s, size_t length)
bool writeLongDouble(long double x)
bool writeU64(uint64_t x)
bool writeU16(uint16_t x)
bool writeU32(uint32_t x)
bool writeLength(size_t length)
T readT(T defaultValue=0)
long double readLongDouble()