BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
7 class mutable_variant_object;
34 const string&
key()
const;
45 typedef std::vector< entry >::const_iterator
iterator;
71 :_key_value(
std::make_shared<
std::vector<
entry> >() )
88 std::shared_ptr< std::vector< entry > > _key_value;
145 void erase(
const string& key );
175 _FC_ASSERT( max_depth > 0,
"Recursion depth exceeded!" );
176 set( std::move(key),
variant( std::forward<T>(var), max_depth - 1 ) );
192 :_key_value( new
std::vector<
entry>() )
203 :_key_value( new
std::vector<
entry>() )
205 set( std::move(key),
variant(std::forward<T>(val)) );
216 std::unique_ptr< std::vector< entry > > _key_value;
228 if( _reached_depth_limit )
235 v =
variant( std::forward<T>(var), _max_depth );
239 if( !_skip_on_exception )
241 v =
variant(
"[ERROR: Caught exception while converting data to variant]" );
243 set( std::move(key), *v );
249 const uint32_t _max_depth;
250 const bool _reached_depth_limit;
251 const bool _skip_on_exception;
255 void to_variant(
const mutable_variant_object& var, variant& vo, uint32_t max_depth = 1 );
257 void from_variant(
const variant& var, mutable_variant_object& vo, uint32_t max_depth = 1 );
iterator find(const string &key) const
An order-perserving dictionary of variant's.
std::vector< entry >::const_iterator iterator
An order-perserving dictionary of variant's.
entry & operator=(const entry &)
variant_object::entry entry
a key/value pair
limited_mutable_variant_object & operator()(string key, T &&var)
bool contains(const char *key) const
const string & key() const
variant_object(string key, T &&val)
mutable_variant_object(string key, T &&val)
const variant & value() const
mutable_variant_object & operator()(string key, T &&var, uint32_t max_depth)
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
mutable_variant_object & set(string key, variant var)
iterator find(const string &key) const
mutable_variant_object & operator=(mutable_variant_object &&)
mutable_variant_object(T &&v)
variant_object & operator=(variant_object &&)
const variant & operator[](const string &key) const
void erase(const string &key)
const variant & operator[](const string &key) const
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
#define _FC_ASSERT(cond, msg)
std::vector< entry >::const_iterator const_iterator
variant_object & get_object()
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
std::vector< entry >::iterator iterator
mutable_variant_object & operator()(string key, variant var, uint32_t max_depth=1)
limited_mutable_variant_object(uint32_t max_depth, bool skip_on_exception=false)