aboutsummaryrefslogtreecommitdiff
path: root/src/stable/string.cpp
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2022-04-20 14:04:47 -0700
committerMike Buland <mbuland@penny-arcade.com>2022-04-20 14:04:47 -0700
commitfd56cdd21a7c9c944ad189cf91ff24d3c2b0f975 (patch)
treef16f7e7f54399ef9c753beb87069eed8122dbccb /src/stable/string.cpp
parentd10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3 (diff)
downloadlibbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.gz
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.bz2
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.xz
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.zip
Gradually moving to better archive structure.
It's dragging other new API changes along with it, including use of Blob and Text.
Diffstat (limited to '')
-rw-r--r--src/stable/string.cpp12
1 files changed, 5 insertions, 7 deletions
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 )
1520 return dst; 1520 return dst;
1521} 1521}
1522 1522
1523#include "bu/blob.h"
1524
1523Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::String &s ) 1525Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::String &s )
1524{ 1526{
1525 long n = s.getSize(); 1527 ar << Bu::Blob( s.getStr(), s.getSize() );
1526 ar << n;
1527 ar.write( s.getConstStr(), n );
1528 return ar; 1528 return ar;
1529} 1529}
1530 1530
1531Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::String &s ) 1531Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::String &s )
1532{ 1532{
1533 long n; 1533 Bu::Blob b;
1534 ar >> n; 1534 ar >> b;
1535 s.setSize( n );
1536 ar.read( s.getStr(), n );
1537 return ar; 1535 return ar;
1538} 1536}
1539 1537