aboutsummaryrefslogtreecommitdiff
path: root/src/stable
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable')
-rw-r--r--src/stable/variant.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/stable/variant.cpp b/src/stable/variant.cpp
index 5100e9c..674ae04 100644
--- a/src/stable/variant.cpp
+++ b/src/stable/variant.cpp
@@ -53,10 +53,17 @@ Bu::Variant::~Variant()
53 53
54Bu::String Bu::Variant::toString() const 54Bu::String Bu::Variant::toString() const
55{ 55{
56 Bu::MemBuf mb; 56 if( getType() == typeid( Bu::String ) )
57 Bu::Formatter f( mb ); 57 {
58 f << *this; 58 return get<Bu::String>();
59 return mb.getString(); 59 }
60 else
61 {
62 Bu::MemBuf mb;
63 Bu::Formatter f( mb );
64 f << *this;
65 return mb.getString();
66 }
60} 67}
61 68
62bool Bu::Variant::isSet() const 69bool Bu::Variant::isSet() const