diff options
Diffstat (limited to 'src/stable/string.cpp')
-rw-r--r-- | src/stable/string.cpp | 12 |
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 | |||
1523 | Bu::Archive &Bu::operator<<( Bu::Archive &ar, const Bu::String &s ) | 1525 | Bu::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 | ||
1531 | Bu::Archive &Bu::operator>>( Bu::Archive &ar, Bu::String &s ) | 1531 | Bu::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 | ||