From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/old/serializer.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/old/serializer.h (limited to 'src/old/serializer.h') diff --git a/src/old/serializer.h b/src/old/serializer.h new file mode 100644 index 0000000..3af489c --- /dev/null +++ b/src/old/serializer.h @@ -0,0 +1,80 @@ +#ifndef SERIALIZABLE_H +#define SERIALIZABLE_H + +#include +#include +#include +//#include "serializable.h" + +class Serializer +{ +private: + bool bLoading; +public: + bool isLoading(); + + enum + { + load = true, + save = false + }; + + Serializer(bool bLoading); + virtual ~Serializer(); + virtual void close()=0; + + virtual void write(const void *, int32_t)=0; + virtual void read(void *, int32_t)=0; + + virtual Serializer &operator<<(bool); + virtual Serializer &operator<<(int8_t); + virtual Serializer &operator<<(int16_t); + virtual Serializer &operator<<(int32_t); + virtual Serializer &operator<<(int64_t); + virtual Serializer &operator<<(uint8_t); + virtual Serializer &operator<<(uint16_t); + virtual Serializer &operator<<(uint32_t); + virtual Serializer &operator<<(uint64_t); + virtual Serializer &operator<<(long); + virtual Serializer &operator<<(float); + virtual Serializer &operator<<(double); + virtual Serializer &operator<<(long double); + + virtual Serializer &operator>>(bool &); + virtual Serializer &operator>>(int8_t &); + virtual Serializer &operator>>(int16_t &); + virtual Serializer &operator>>(int32_t &); + virtual Serializer &operator>>(int64_t &); + virtual Serializer &operator>>(uint8_t &); + virtual Serializer &operator>>(uint16_t &); + virtual Serializer &operator>>(uint32_t &); + virtual Serializer &operator>>(uint64_t &); + virtual Serializer &operator>>(long &); + virtual Serializer &operator>>(float &); + virtual Serializer &operator>>(double &); + virtual Serializer &operator>>(long double &); + + virtual Serializer &operator&&(bool &); + virtual Serializer &operator&&(int8_t &); + virtual Serializer &operator&&(int16_t &); + virtual Serializer &operator&&(int32_t &); + virtual Serializer &operator&&(int64_t &); + virtual Serializer &operator&&(uint8_t &); + virtual Serializer &operator&&(uint16_t &); + virtual Serializer &operator&&(uint32_t &); + virtual Serializer &operator&&(uint64_t &); + virtual Serializer &operator&&(float &); + virtual Serializer &operator&&(double &); + virtual Serializer &operator&&(long double &); + + //virtual Serializer &operator&(Serializable &); +}; + +Serializer &operator<<(Serializer &, class Serializable &); +Serializer &operator>>(Serializer &, class Serializable &); +Serializer &operator&&(Serializer &s, class Serializable &p); + +Serializer &operator<<(Serializer &, std::string &); +Serializer &operator>>(Serializer &, std::string &); + +#endif -- cgit v1.2.3