8 #define SCARAB_API_EXPORTS 12 using std::stringstream;
43 for( contents::const_iterator it = orig.f_contents.begin(); it != orig.f_contents.end(); ++it )
45 f_contents[it->first] = it->second->move_clone();
69 for( contents::const_iterator it = rhs.f_contents.begin(); it != rhs.f_contents.end(); ++it )
71 f_contents[it->first] = it->second->move_clone();
79 if( ! a_subset.
is_node() )
return false;
82 for( contents::const_iterator t_subset_it = t_subset_node.
f_contents.begin(); t_subset_it != t_subset_node.
f_contents.end(); ++t_subset_it )
84 if( !
has( t_subset_it->first ) )
return false;
85 if( !
f_contents.at( t_subset_it->first )->has_subset( *t_subset_it->second ) )
return false;
93 for( contents::const_iterator it = a_object.
f_contents.begin(); it != a_object.
f_contents.end(); ++it )
95 if( !
has( it->first ) )
98 add( it->first, *it->second );
102 param& t_param = (*this)[ it->first ];
103 if( t_param.
is_value() && it->second->is_value() )
109 if( t_param.
is_node() && it->second->is_node() )
115 if( t_param.
is_array() && it->second->is_array() )
123 this->
replace( it->first, *it->second );
133 out <<
'\n' << indentation <<
"{\n";
134 param::s_indent_level++;
137 out << indentation <<
" " << it->first <<
" : " << *(it->second) <<
'\n';
139 param::s_indent_level--;
140 out << indentation <<
"}\n";
void replace(const std::string &a_name, const param &a_value)
Creates a copy of a_value; overwrites if the key exits.
param & operator=(const param &rhs)
void merge(const param_node &a_object)
virtual bool is_value() const
void merge(const param_array &an_array)
static unsigned s_indent_level
virtual bool has_subset(const param &a_subset) const
param_node & operator=(const param_node &rhs)
virtual bool is_array() const
SCARAB_API std::ostream & operator<<(std::ostream &out, const param_array &a_value)
virtual bool is_node() const
bool add(const std::string &a_name, const param &a_value)
bool has(const std::string &a_name) const
virtual std::string to_string() const