It's now a std::string.
{
if (model.valid()) {
- fgSetString("/ai/models/model-added", props->getPath());
+ fgSetString("/ai/models/model-added", props->getPath().c_str());
} else if (!model_path.empty()) {
SG_LOG(SG_INPUT, SG_WARN, "AIBase: Could not load model " << model_path);
bool
FGMenuBar::enable_item(const SGPropertyNode * node, bool state)
{
- const char *path = node->getPath();
+ string path = node->getPath();
if (_objects.find(path) == _objects.end()) {
SG_LOG(SG_GENERAL, SG_ALERT, "Trying to enable/disable "
"non-existent menu item for node `" << path << '\'');
#ifndef _PROPERTY_LIST_HXX
#define _PROPERTY_LIST_HXX
+#include <string>
#include <plib/puAux.h>
#include <simgear/props/props.hxx>
void toggleVerbosity() { _verbose = !_verbose; }
// overridden plib pui methods
- virtual char *getStringValue(void) { return (char *)(_return ? _return->getPath(true) : ""); }
+ virtual char *getStringValue(void)
+ {
+ _return_path.clear();
+ if (_return)
+ _return_path = _return->getPath(true);
+ return const_cast<char*>(_return_path.c_str());
+ }
//virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); }
virtual void setValue(const char *);
bool _dot_files; // . and .. pseudo-dirs currently shown?
bool _verbose; // show SGPropertyNode flags
+ std::string _return_path;
};
return "";
}
- return _extCourseSource->getPath(true);
+ return _extCourseSource->getPath(true).c_str();
}
void
fgGetNode(entry->getStringValue("property"), true);
log.nodes.push_back(node);
(*log.output) << log.delimiter
- << entry->getStringValue("title", node->getPath());
+ << entry->getStringValue("title", node->getPath().c_str());
}
(*log.output) << endl;
}
const char* src = n->getStringValue("script");
if(!n->hasChild("script")) src = 0; // Hrm...
if(src)
- createModule(module, n->getPath(), src, strlen(src));
+ createModule(module, n->getPath().c_str(), src, strlen(src));
if(!file_specified && !src)
SG_LOG(SG_NASAL, SG_ALERT, "Nasal error: " <<
{
const char* nasal = arg->getStringValue("script");
const char* moduleName = arg->getStringValue("module");
- naRef code = parse(arg->getPath(true), nasal, strlen(nasal));
+ naRef code = parse(arg->getPath(true).c_str(), nasal, strlen(nasal));
if(naIsNil(code)) return false;
// Commands can be run "in" a module. Make sure that module