X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Futil.cxx;h=0986e91ea47a71c93b9595c25affa837743abc22;hb=4be1661305609819703015360b79bbb7e4ae87d6;hp=909cbad12657fb5f0daa46cc46792ad2e29dee52;hpb=76a13e689d5c55def97074a98fc9b0efc31df624;p=flightgear.git diff --git a/src/Main/util.cxx b/src/Main/util.cxx index 909cbad12..0986e91ea 100644 --- a/src/Main/util.cxx +++ b/src/Main/util.cxx @@ -25,7 +25,7 @@ #include #include -SG_USING_STD(vector); +using std::vector; #include @@ -198,12 +198,20 @@ fgUnescape (const char *s) } +// Write out path to validation node and read it back in. A Nasal +// listener is supposed to replace the path with a validated version +// or an empty string otherwise. const char *fgValidatePath (const char *str, bool write) { static SGPropertyNode_ptr r, w; if (!r) { r = fgGetNode("/sim/paths/validate/read", true); + r->setAttribute(SGPropertyNode::READ, true); + r->setAttribute(SGPropertyNode::WRITE, true); + w = fgGetNode("/sim/paths/validate/write", true); + w->setAttribute(SGPropertyNode::READ, true); + w->setAttribute(SGPropertyNode::WRITE, true); } SGPropertyNode *prop = write ? w : r; prop->setStringValue(str);