static void
show_values (const SGPropertyNode * node)
{
- cout << "Bool: " << node->getBoolValue() << endl;
+ cout << "Bool: " << (node->getBoolValue() ? "true" : "false") << endl;
cout << "Int: " << node->getIntValue() << endl;
cout << "Float: " << node->getFloatValue() << endl;
cout << "Double: " << node->getDoubleValue() << endl;
static void
dump_node (const SGPropertyNode * node)
{
- writeProperties(cout, node);
+ writeProperties(cout, node, true);
}
static void
cout << endl;
cout << "Looking for all /hack[0]/bar children" << endl;
- vector<SGPropertyNode *> bar = child->getChildren("bar");
+ vector<SGPropertyNode_ptr> bar = child->getChildren("bar");
cout << "There are " << bar.size() << " matches" << endl;
for (int i = 0; i < (int)bar.size(); i++)
cout << bar[i]->getName() << '[' << bar[i]->getIndex() << ']' << endl;
test_property_nodes();
for (int i = 1; i < ac; i++) {
- cout << "Reading " << av[i] << endl;
- SGPropertyNode root;
- readProperties(av[i], &root);
- writeProperties(cout, &root);
- cout << endl;
+ try {
+ cout << "Reading " << av[i] << endl;
+ SGPropertyNode root;
+ readProperties(av[i], &root);
+ writeProperties(cout, &root, true);
+ cout << endl;
+ } catch (string &message) {
+ cout << "Aborted with " << message << endl;
+ }
}
return 0;