| 242 | } |
| 243 | |
| 244 | static SDObject *importXMLConfig(StreamReader &stream) |
| 245 | { |
| 246 | rdcstr buf; |
| 247 | buf.resize((size_t)stream.GetSize()); |
| 248 | stream.Read(buf.data(), buf.size()); |
| 249 | |
| 250 | pugi::xml_document doc; |
| 251 | doc.load_string(buf.c_str(), pugi::parse_default | pugi::parse_comments); |
| 252 | |
| 253 | pugi::xml_node root = doc.child("config"); |
| 254 | |
| 255 | SDObject *ret = new SDObject("config"_lit, "config"_lit); |
| 256 | |
| 257 | if(root) |
| 258 | { |
| 259 | for(pugi::xml_node child = root.first_child(); child; child = child.next_sibling()) |
| 260 | { |
| 261 | SDObject *childObj = XML2Config(child); |
| 262 | if(childObj) |
| 263 | ret->AddAndOwnChild(XML2Config(child)); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | return ret; |
| 268 | } |
| 269 | |
| 270 | static void exportXMLConfig(StreamWriter &stream, const SDObject *obj) |
| 271 | { |
no test coverage detected