32#include "FGPropertyManager.h"
56 for(
auto& property: tied_properties)
59 tied_properties.clear();
66 auto it = tied_properties.begin();
68 while(it != tied_properties.end()) {
70 if (property->BindingInstance == instance) {
72 tied_properties.erase(property);
84 for(i=0;i<name.length();i++) {
85 if( lowercase && isupper(name[i]) )
86 name[i]=tolower(name[i]);
87 else if( isspace(name[i]) )
99 size_t initial_location=0;
100 size_t found_location;
102 found_location = temp_string.rfind(
"/");
103 if (found_location != string::npos)
104 temp_string = temp_string.substr(found_location);
106 found_location = temp_string.find(
'_',initial_location);
107 while (found_location != string::npos) {
108 temp_string.replace(found_location,1,
" ");
109 initial_location = found_location+1;
110 found_location = temp_string.find(
'_',initial_location);
121 if (!parent)
return "/";
133string GetRelativeName(
const SGPropertyNode* node,
const string &path)
135 string temp_string = GetFullyQualifiedName(node);
136 size_t len = path.length();
137 if ( (len > 0) && (temp_string.substr(0,len) == path) ) {
138 temp_string = temp_string.erase(0,len);
149 cerr <<
"Attempt to untie a non-existant property." << name << endl;
160 const string& name =
property->getNameString();
162 assert(property->
isTied());
164 for (
auto it = tied_properties.begin(); it != tied_properties.end(); ++it) {
165 if (it->node.ptr() == property) {
167 tied_properties.erase(it);
168 if (FGJSBBase::debug_lvl & 0x20) cout <<
"Untied " << name << endl;
173 cerr <<
"Failed to untie property " << name << endl
174 <<
"JSBSim is not the owner of this property." << endl;
void Untie(const std::string &name)
Untie a property from an external data source.
std::string mkPropertyName(std::string name, bool lowercase)
Property-ify a name replaces spaces with '-' and, optionally, makes name all lower case.
void Unbind(void)
Unbind all properties bound by this manager to an external data source.
A node in a property tree.
bool isTied() const
Test whether this node is bound to an external data source.
SGPropertyNode * getParent()
Get a non-const pointer to the node's parent.
std::string getDisplayName(bool simplify=false) const
Get the node's pretty display name, with subscript when needed.
const std::string & getNameString() const
Get the node's simple name as a string.