From 4219be08c02b3f0a5ec214447dfa0918fa390176 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Mar 2020 13:16:22 -0700 Subject: Temporary interop to convert blob to strings. This will make the transition easier and require fewer rewrites later. --- src/stable/string.cpp | 6 ++++++ src/stable/string.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/stable/string.cpp b/src/stable/string.cpp index 1e00ba5..dac690b 100644 --- a/src/stable/string.cpp +++ b/src/stable/string.cpp @@ -12,6 +12,7 @@ #include "bu/hash.h" #include "bu/membuf.h" #include "bu/formatter.h" +#include "bu/blob.h" #include #define nMinSize (256) @@ -162,6 +163,11 @@ Bu::String::String( long nSize ) core->nLength = nSize; } +Bu::String::String( const class Bu::Blob &rSrc ) +{ + append( rSrc.getData(), rSrc.getSize() ); +} + Bu::String::String( const Bu::String::const_iterator &s ) { append( s ); diff --git a/src/stable/string.h b/src/stable/string.h index a5e21cb..89601a7 100644 --- a/src/stable/string.h +++ b/src/stable/string.h @@ -23,6 +23,7 @@ namespace Bu { class String; + class Blob; class MemBuf; /** @cond DEVEL */ @@ -573,6 +574,7 @@ namespace Bu String( const String &rSrc, long nLength ); String( const String &rSrc, long nStart, long nLength ); String( long nSize ); + String( const class Blob &rSrc ); virtual ~String(); /** -- cgit v1.2.3