31 using namespace YSLib;
38 auto s(node.GetSize());
44 auto i(node.GetBegin());
49 const auto& new_name([&]{
52 const auto& str(Access<string>(*i));
66 if(n.GetName().empty())
67 return {0, new_name, std::move(n.Value)};
71 auto p_node_cont(make_unique<ValueNode::Container>());
73 std::for_each(i, node.GetEnd(), [&](
const ValueNode& n){
76 return {0, new_name, p_node_cont.release(),
PointerTag()};
85 WritePrefix(
File& f,
size_t n = 1,
char c =
'\t')
98 for(
const auto& n : node)
100 WritePrefix(f, depth);
104 WriteNode(f, n, depth + 1);
106 catch(std::out_of_range&)
108 WritePrefix(f, depth);
117 EscapeNodeString(
const string& str)
122 return c == char() ? std::move(content) : c + content + c;
129 WritePrefix(f, depth);
135 const auto& s(Access<string>(node));
137 f <<
' ' <<
'"' << EscapeNodeString(s) <<
'"' <<
'\n';
143 for(
const auto& n : node)
145 WritePrefix(f, depth);
149 WriteNodeC(f, n, depth + 1);
151 catch(std::out_of_range&)
153 WritePrefix(f, depth);
165 return WriteNodeC(f, conf.GetRoot(), 0);
180 "Bad configuration found: cast failed from [%s] to [%s] .",