aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2020-03-24 13:16:22 -0700
committerMike Buland <eichlan@xagasoft.com>2020-03-24 13:16:22 -0700
commit4219be08c02b3f0a5ec214447dfa0918fa390176 (patch)
treeb0b9cf359471db16fc6b1de8b3a3daffdac81fa6
parentde026982f5273807669c13fab9c79dffaeb8c253 (diff)
downloadlibbu++-4219be08c02b3f0a5ec214447dfa0918fa390176.tar.gz
libbu++-4219be08c02b3f0a5ec214447dfa0918fa390176.tar.bz2
libbu++-4219be08c02b3f0a5ec214447dfa0918fa390176.tar.xz
libbu++-4219be08c02b3f0a5ec214447dfa0918fa390176.zip
Temporary interop to convert blob to strings.
This will make the transition easier and require fewer rewrites later.
-rw-r--r--src/stable/string.cpp6
-rw-r--r--src/stable/string.h2
2 files changed, 8 insertions, 0 deletions
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 @@
12#include "bu/hash.h" 12#include "bu/hash.h"
13#include "bu/membuf.h" 13#include "bu/membuf.h"
14#include "bu/formatter.h" 14#include "bu/formatter.h"
15#include "bu/blob.h"
15#include <stdlib.h> 16#include <stdlib.h>
16 17
17#define nMinSize (256) 18#define nMinSize (256)
@@ -162,6 +163,11 @@ Bu::String::String( long nSize )
162 core->nLength = nSize; 163 core->nLength = nSize;
163} 164}
164 165
166Bu::String::String( const class Bu::Blob &rSrc )
167{
168 append( rSrc.getData(), rSrc.getSize() );
169}
170
165Bu::String::String( const Bu::String::const_iterator &s ) 171Bu::String::String( const Bu::String::const_iterator &s )
166{ 172{
167 append( s ); 173 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 @@
23namespace Bu 23namespace Bu
24{ 24{
25 class String; 25 class String;
26 class Blob;
26 class MemBuf; 27 class MemBuf;
27 28
28 /** @cond DEVEL */ 29 /** @cond DEVEL */
@@ -573,6 +574,7 @@ namespace Bu
573 String( const String &rSrc, long nLength ); 574 String( const String &rSrc, long nLength );
574 String( const String &rSrc, long nStart, long nLength ); 575 String( const String &rSrc, long nStart, long nLength );
575 String( long nSize ); 576 String( long nSize );
577 String( const class Blob &rSrc );
576 virtual ~String(); 578 virtual ~String();
577 579
578 /** 580 /**