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/string.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/stable/string.cpp') diff --git a/src/stable/string.cpp b/src/stable/string.cpp index c36b768..81f2c7f 100644 --- a/src/stable/string.cpp +++ b/src/stable/string.cpp @@ -1520,20 +1520,18 @@ Bu::String &Bu::operator<<( Bu::String &dst, const Bu::String &sIn ) return dst; } +#include "bu/blob.h" + Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::String &s ) { - long n = s.getSize(); - ar << n; - ar.write( s.getConstStr(), n ); + ar << Bu::Blob( s.getStr(), s.getSize() ); return ar; } Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::String &s ) { - long n; - ar >> n; - s.setSize( n ); - ar.read( s.getStr(), n ); + Bu::Blob b; + ar >> b; return ar; } -- cgit v1.2.3