From 53bb959c5d3d5351f7058f7694a920f045836222 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 15 Nov 2012 12:08:31 -0500 Subject: [PATCH] expanded filesystem api + value api --- src/filesystem.cpp | 2 +- src/value.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/filesystem.cpp b/src/filesystem.cpp index cbd9983..8d3ffc6 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -76,5 +76,5 @@ namespace fc { bool is_regular_file( const path& p ) { return boost::filesystem::is_regular_file(p); } uint64_t file_size( const path& p ) { return boost::filesystem::file_size(p); } void copy( const path& f, const path& t ) { boost::filesystem::copy( f, t ); } - void remove( const path& f ) { boost::filesystem::remove( f, t ); } + bool remove( const path& f ) { return boost::filesystem::remove( f ); } } diff --git a/src/value.cpp b/src/value.cpp index 892ca12..c29ac2a 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -185,7 +185,7 @@ value::value( char* c ) { new (holder) detail::value_holder_impl( c ); } value::~value() { - gh(holder)->~value_holder_impl(); + gh(holder)->~value_holder(); } value::value( int8_t v){ static_assert( sizeof(holder) >= sizeof( detail::value_holder_impl ), "size check" ); @@ -364,5 +364,14 @@ void value::visit( value::const_visitor&& v )const { auto h = ((detail::value_holder*)&holder[0]); h->visit( fc::move(v) ); } +/* sets the subkey key with v and return *this */ +value& value::set( const char* key, fc::value v ) { + (*this)[key] = fc::move(v); + return *this; +} +value& value::set( const fc::string& key, fc::value v ) { + (*this)[key.c_str()] = fc::move(v); + return *this; +} } // namepace fc