Go to the documentation of this file.
5 #ifndef CNOID_UTIL_VALUE_TREE_UTIL_H
6 #define CNOID_UTIL_VALUE_TREE_UTIL_H
12 template<
class Container>
13 bool writeElements(
Mapping& mapping,
const std::string& key,
const Container& elements,
bool isFlowStyle =
false)
19 for(
typename Container::const_iterator p = elements.begin(); p != elements.end(); ++p){
22 if(!listing->
empty()){
23 mapping.
insert(key, listing);
29 template<
class Container>
34 for(
int i=0; i < listing.
size(); ++i){
35 elements.push_back(listing[i].to<typename Container::value_type>());
38 return !elements.
empty();
bool isValid() const
Definition: ValueTree.h:54
Definition: ValueTree.h:253
bool writeElements(Mapping &mapping, const std::string &key, const Container &elements, bool isFlowStyle=false)
Definition: ValueTreeUtil.h:13
bool empty() const
Definition: ValueTree.h:501
int size() const
Definition: ValueTree.h:502
Definition: ValueTree.h:486
Definition: AbstractSceneLoader.h:11
Listing * findListing(const std::string &key) const
Definition: ValueTree.cpp:578
void append(ValueNode *node)
Definition: ValueTree.h:551
bool readElements(const Mapping &mapping, const std::string &key, Container &elements)
Definition: ValueTreeUtil.h:30
void setFlowStyle(bool isFlowStyle=true)
Definition: ValueTree.h:506
void insert(const std::string &key, ValueNode *node)
Definition: ValueTree.cpp:701