From fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Apr 2022 14:04:47 -0700 Subject: Gradually moving to better archive structure. It's dragging other new API changes along with it, including use of Blob and Text. --- src/stable/archive.cpp | 84 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 30 deletions(-) (limited to 'src/stable/archive.cpp') diff --git a/src/stable/archive.cpp b/src/stable/archive.cpp index df9b1ff..829e7eb 100644 --- a/src/stable/archive.cpp +++ b/src/stable/archive.cpp @@ -17,181 +17,205 @@ Bu::Archive::~Archive() Bu::Archive &Bu::operator<<( Bu::Archive &ar, bool p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, char p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, signed char p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, unsigned char p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, signed short p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, unsigned short p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, signed int p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, unsigned int p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, signed long p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, unsigned long p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, signed long long p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, unsigned long long p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, float p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, double p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); return ar; } Bu::Archive &Bu::operator<<( Bu::Archive &ar, long double p) { - ar.write( &p, sizeof(p) ); + ar.write( p ); + return ar; +} + +Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::Blob &p) +{ + ar.write( p ); + return ar; +} + +Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::Text &p) +{ + ar.write( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, bool &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, char &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, signed char &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, unsigned char &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, signed short &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, unsigned short &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, signed int &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, unsigned int &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, signed long &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, unsigned long &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, signed long long &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, unsigned long long &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, float &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, double &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, long double &p) { - ar.read( &p, sizeof(p) ); + ar.read( p ); + return ar; +} + +Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::Blob &p) +{ + ar.read( p ); + return ar; +} + +Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::Text &p) +{ + ar.read( p ); return ar; } -- cgit v1.2.3