int CMetarStation::initialize()
{
- // Read the list of metar stations, decoding and adding to global list.
+ // Read the list of metar stations, decoding and adding to global list.
- CMetarStation *m;
- char buf[256];
+ CMetarStation *m;
+ char buf[256];
- // Goto the Flight Gear installation directory
+ // Goto the Flight Gear installation directory
#ifdef TESTPROG
- FGPath weatherPath( "/mkv/Build/FlightGear" );
+ //FGPath weatherPath( "/mkv/Build/FlightGear" );
+ FGPath weatherPath( ":Data" );
#else
FGPath weatherPath( current_options.get_fg_root() );
#endif
- weatherPath.append( "Weather/MetarStations" );
- // Open the metar station list
- FILE *f = fopen( weatherPath.c_str(), "r" );
+ weatherPath.append( "Weather" );
+ weatherPath.append( "MetarStations" );
+ // Open the metar station list
+ FILE *f = fopen( weatherPath.c_str(), "r" );
- if ( f != NULL )
- {
- // Read each line, create an instance of a station, and add it to the vector
- while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 )
- {
- //std::cout << buf << std::endl;
- m = new CMetarStation( buf );
- //m->dump();
- METAR_Stations.push_back( m );
- }
-
- // Close the list
- fclose( f );
- std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
- return 1;
- }
- else
- {
- std::cout << "Could not open MetarStations file " << std::endl;
- return 0;
+ if ( f != NULL ) {
+ // Read each line, create an instance of a station, and add it to the vector
+ while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 ) {
+ //std::cout << buf << std::endl;
+ m = new CMetarStation( buf );
+ //m->dump();
+ METAR_Stations.push_back( m );
}
+
+ // Close the list
+ fclose( f );
+ // std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
+ return 1;
+ } else {
+ // std::cout << "Could not open MetarStations file " << std::endl;
+ return 0;
+ }
}
* Returns true on success (i.e. the value is not currently tied).
*/
bool
-SGValue::tieBool (bool_getter getter, bool_setter setter = 0,
- bool useDefault = true)
+SGValue::tieBool (bool_getter getter, bool_setter setter,
+ bool useDefault)
{
if (_tied) {
return false;
* Returns true on success (i.e. the value is not currently tied).
*/
bool
-SGValue::tieInt (int_getter getter, int_setter setter = 0,
- bool useDefault = true)
+SGValue::tieInt (int_getter getter, int_setter setter,
+ bool useDefault)
{
if (_tied) {
return false;
* Returns true on success (i.e. the value is not currently tied).
*/
bool
-SGValue::tieFloat (float_getter getter, float_setter setter = 0,
- bool useDefault = true)
+SGValue::tieFloat (float_getter getter, float_setter setter,
+ bool useDefault)
{
if (_tied) {
return false;
* Returns true on success (i.e. the value is not currently tied).
*/
bool
-SGValue::tieDouble (double_getter getter, double_setter setter = 0,
- bool useDefault = true)
+SGValue::tieDouble (double_getter getter, double_setter setter,
+ bool useDefault)
{
if (_tied) {
return false;
* Returns true on success (i.e. the value is not currently tied).
*/
bool
-SGValue::tieString (string_getter getter, string_setter setter = 0,
- bool useDefault = true)
+SGValue::tieString (string_getter getter, string_setter setter,
+ bool useDefault)
{
if (_tied) {
return false;
* and must not end with '/'.
*/
SGValue *
-SGPropertyList::getValue (const string &name, bool create = false)
+SGPropertyList::getValue (const string &name, bool create)
{
const_iterator el = _props.find(name);
if (el == _props.end()) {
SGPropertyList::tieBool (const string &name,
bool_getter getter,
bool_setter setter,
- bool useDefault = true)
+ bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying bool property '" << name << '\'');
return getValue(name, true)->tieBool(getter, setter, useDefault);
SGPropertyList::tieInt (const string &name,
int_getter getter,
int_setter setter,
- bool useDefault = true)
+ bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying int property '" << name << '\'');
return getValue(name, true)->tieInt(getter, setter, useDefault);
SGPropertyList::tieFloat (const string &name,
float_getter getter,
float_setter setter,
- bool useDefault = true)
+ bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying float property '" << name << '\'');
return getValue(name, true)->tieFloat(getter, setter, useDefault);
SGPropertyList::tieDouble (const string &name,
double_getter getter,
double_setter setter,
- bool useDefault = true)
+ bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying double property '" << name << '\'');
return getValue(name, true)->tieDouble(getter, setter, useDefault);
SGPropertyList::tieString (const string &name,
string_getter getter,
string_setter setter,
- bool useDefault = true)
+ bool useDefault)
{
FG_LOG(FG_GENERAL, FG_INFO, "Tying string property '" << name << '\'');
return getValue(name, true)->tieString(getter, setter, useDefault);
/**
* Constructor.
*/
-SGPropertyNode::SGPropertyNode (const string &path = "",
- SGPropertyList * props = 0)
+SGPropertyNode::SGPropertyNode (const string &path,
+ SGPropertyList * props)
: _props(props), _node(0)
{
setPath(path);