Add new PROTECTED property attribute
This commit is contained in:
@@ -827,7 +827,7 @@ SGPropertyNode::trace_read () const
|
||||
* Last used attribute
|
||||
* Update as needed when enum Attribute is changed
|
||||
*/
|
||||
const int SGPropertyNode::LAST_USED_ATTRIBUTE = PRESERVE;
|
||||
const int SGPropertyNode::LAST_USED_ATTRIBUTE = PROTECTED;
|
||||
|
||||
/**
|
||||
* Default constructor: always creates a root node.
|
||||
|
||||
@@ -814,7 +814,8 @@ public:
|
||||
TRACE_READ = 16,
|
||||
TRACE_WRITE = 32,
|
||||
USERARCHIVE = 64,
|
||||
PRESERVE = 128
|
||||
PRESERVE = 128,
|
||||
PROTECTED = 1 << 8,
|
||||
// beware: if you add another attribute here,
|
||||
// also update value of "LAST_USED_ATTRIBUTE".
|
||||
};
|
||||
@@ -1854,7 +1855,7 @@ private:
|
||||
mutable std::string _buffer;
|
||||
simgear::props::Type _type;
|
||||
bool _tied;
|
||||
int _attr;
|
||||
int _attr = NO_ATTR;
|
||||
|
||||
// The right kind of pointer...
|
||||
union {
|
||||
|
||||
@@ -251,6 +251,9 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
|
||||
setFlag(mode, SGPropertyNode::USERARCHIVE, val, location);
|
||||
else if( att_name == "preserve" )
|
||||
setFlag(mode, SGPropertyNode::PRESERVE, val, location);
|
||||
// note we intentionally don't handle PROTECTED here, it's
|
||||
// designed to be only set from compiled code, not loaded
|
||||
// dynamically.
|
||||
|
||||
// Check for an alias.
|
||||
else if( att_name == "alias" )
|
||||
|
||||
Reference in New Issue
Block a user