]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_props.hxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Main / fg_props.hxx
index 8a6c28bcddc374f90897e03c0717f7730da9b71e..2eae51b8fd27d7813726270d8825518ea02035c6 100644 (file)
@@ -7,9 +7,11 @@
 
 \f
 ////////////////////////////////////////////////////////////////////////
-// Loading and saving properties.
+// Property management.
 ////////////////////////////////////////////////////////////////////////
 
+extern void fgInitProps ();    // fixme: how are they untied?
+extern void fgUpdateProps ();
 extern bool fgSaveFlight (ostream &output);
 extern bool fgLoadFlight (istream &input);
 
@@ -19,22 +21,34 @@ extern bool fgLoadFlight (istream &input);
 // Convenience functions for getting property values.
 ////////////////////////////////////////////////////////////////////////
 
+
 /**
- * Get an SGValue pointer that can be queried repeatedly.
+ * Get a property node.
  *
- * If the property value is going to be accessed within the loop,
- * it is best to use this method for maximum efficiency.
+ * @param path The path of the node, relative to root.
+ * @param create true to create the node if it doesn't exist.
+ * @return The node, or 0 if none exists and none was created.
  */
-inline SGValue * fgGetValue (const string &name, bool create = false)
+inline SGPropertyNode * 
+fgGetNode (const string &path, bool create = false)
 {
-  return globals->get_props()->getValue(name, create);
+  return globals->get_props()->getNode(path, create);
 }
 
-inline bool fgHasValue (const string &name)
+
+/**
+ * Test whether a given node exists.
+ *
+ * @param path The path of the node, relative to root.
+ * @return true if the node exists, false otherwise.
+ */
+inline bool
+fgHasNode (const string &path)
 {
-  return globals->get_props()->hasValue(name);
+  return (fgGetNode(path, false) != 0);
 }
 
+
 inline bool fgGetBool (const string &name, bool defaultValue = false)
 {
   return globals->get_props()->getBoolValue(name, defaultValue);