1
0
Fork 0

Fix (nearly) all the std:: namespace violations in headers, in preparation for fixing SGsmplstat.hxx to *not* do a 'using namespace std'.

This commit is contained in:
James Turner 2011-10-17 17:41:59 +01:00
parent 3d861475f7
commit b1b4b7ecf4
114 changed files with 320 additions and 231 deletions

View file

@ -134,7 +134,7 @@ public:
string _path; string _path;
string _callsign; string _callsign;
string _submodel; string _submodel;
string _name; std::string _name;
string _parent; string _parent;
SGGeod userpos; SGGeod userpos;

View file

@ -40,8 +40,8 @@
#include <GUI/gui.h> // mkDialog #include <GUI/gui.h> // mkDialog
#include <GUI/new_gui.hxx> #include <GUI/new_gui.hxx>
typedef vector<string> StringVec; typedef std::vector<std::string> StringVec;
typedef vector<string>:: iterator StringVecIterator; typedef StringVec::iterator StringVecIterator;
class FGATCDialogNew { class FGATCDialogNew {

View file

@ -41,6 +41,8 @@
#include <sstream> #include <sstream>
using std::ostringstream; using std::ostringstream;
using std::cerr;
using std::endl;
FGATCDialog *current_atcdialog; FGATCDialog *current_atcdialog;

View file

@ -59,6 +59,8 @@
#include "ATCutils.hxx" #include "ATCutils.hxx"
#include "ATCmgr.hxx" #include "ATCmgr.hxx"
using std::string;
using std::map;
using std::cout; using std::cout;
using std::cout; using std::cout;
using boost::ref; using boost::ref;

View file

@ -51,6 +51,8 @@
#include <ATC/CommStation.hxx> #include <ATC/CommStation.hxx>
using std::vector; using std::vector;
using std::pair;
using namespace flightgear; using namespace flightgear;
// magic import of a helper which uses FGPositioned internals // magic import of a helper which uses FGPositioned internals
@ -76,7 +78,6 @@ FGAirport::FGAirport(const string &id, const SGGeod& location, const SGGeod& tow
FGAirport::~FGAirport() FGAirport::~FGAirport()
{ {
cerr << "Deleting Airport" << endl;
delete _dynamics; delete _dynamics;
} }
@ -552,7 +553,7 @@ FGAirport::selectSID(const SGGeod& aDest, FGRunway* aRwy)
<< (aRwy ? aRwy->ident() : "no runway preference")); << (aRwy ? aRwy->ident() : "no runway preference"));
} }
return make_pair(sid, enroute); return std::make_pair(sid, enroute);
} }
pair<STAR*, WayptRef> pair<STAR*, WayptRef>
@ -584,7 +585,7 @@ FGAirport::selectSTAR(const SGGeod& aOrigin, FGRunway* aRwy)
} }
} // of STAR iteration } // of STAR iteration
return make_pair(star, enroute); return std::make_pair(star, enroute);
} }

View file

@ -51,7 +51,7 @@ double AnalogComponent::clamp( double value ) const
bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_ptr configNode ) bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_ptr configNode )
{ {
SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" << endl ); SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" );
if( Component::configure( nodeName, configNode ) ) if( Component::configure( nodeName, configNode ) )
return true; return true;
@ -108,6 +108,6 @@ bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_pt
return true; return true;
} }
SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ") [unhandled]" << endl ); SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ") [unhandled]" );
return false; return false;
} }

View file

@ -36,6 +36,9 @@
#include "Main/fg_props.hxx" #include "Main/fg_props.hxx"
using std::map;
using std::string;
using namespace FGXMLAutopilot; using namespace FGXMLAutopilot;
Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode ) : Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode ) :
@ -58,13 +61,13 @@ Autopilot::Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode
SGPropertyNode_ptr node = configNode->getChild(i); SGPropertyNode_ptr node = configNode->getChild(i);
string childName = node->getName(); string childName = node->getName();
if( componentForge.count(childName) == 0 ) { if( componentForge.count(childName) == 0 ) {
SG_LOG( SG_AUTOPILOT, SG_BULK, "unhandled element <" << childName << ">" << endl ); SG_LOG( SG_AUTOPILOT, SG_BULK, "unhandled element <" << childName << ">" << std::endl );
continue; continue;
} }
Component * component = (*componentForge[childName])(node); Component * component = (*componentForge[childName])(node);
if( component->get_name().length() == 0 ) { if( component->get_name().length() == 0 ) {
ostringstream buf; std::ostringstream buf;
buf << "unnamed_component_" << i; buf << "unnamed_component_" << i;
component->set_name( buf.str() ); component->set_name( buf.str() );
} }
@ -96,7 +99,7 @@ void Autopilot::add_component( Component * component )
// check for duplicate name // check for duplicate name
std::string name = component->get_name(); std::string name = component->get_name();
for( unsigned i = 0; get_subsystem( name.c_str() ) != NULL; i++ ) { for( unsigned i = 0; get_subsystem( name.c_str() ) != NULL; i++ ) {
ostringstream buf; std::ostringstream buf;
buf << component->get_name() << "_" << i; buf << component->get_name() << "_" << i;
name = buf.str(); name = buf.str();
} }

View file

@ -36,7 +36,8 @@
#include <simgear/structure/exception.hxx> #include <simgear/structure/exception.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::vector;
using std::string;
using simgear::PropertyList; using simgear::PropertyList;
class FGXMLAutopilotGroupImplementation : public FGXMLAutopilotGroup class FGXMLAutopilotGroupImplementation : public FGXMLAutopilotGroup
@ -111,7 +112,7 @@ void FGXMLAutopilotGroupImplementation::initFrom( SGPropertyNode_ptr rootNode, c
// check for duplicate names // check for duplicate names
string name = apName; string name = apName;
for( unsigned i = 0; get_subsystem( apName.c_str() ) != NULL; i++ ) { for( unsigned i = 0; get_subsystem( apName.c_str() ) != NULL; i++ ) {
ostringstream buf; std::ostringstream buf;
buf << name << "_" << i; buf << name << "_" << i;
apName = buf.str(); apName = buf.str();
} }

View file

@ -58,7 +58,7 @@ bool Component::configure( SGPropertyNode_ptr configNode )
bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr configNode ) bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr configNode )
{ {
SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << endl ); SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << std::endl );
if ( nodeName == "name" ) { if ( nodeName == "name" ) {
_name = configNode->getStringValue(); _name = configNode->getStringValue();
@ -97,7 +97,7 @@ bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr conf
return true; return true;
} // enable } // enable
SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ") [unhandled]" << endl ); SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ") [unhandled]" << std::endl );
return false; return false;
} }

View file

@ -24,6 +24,7 @@
#include "digitalcomponent.hxx" #include "digitalcomponent.hxx"
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::string;
using namespace FGXMLAutopilot; using namespace FGXMLAutopilot;
DigitalComponent::DigitalComponent() : DigitalComponent::DigitalComponent() :

View file

@ -25,6 +25,11 @@
#include "functor.hxx" #include "functor.hxx"
#include <deque> #include <deque>
using std::map;
using std::string;
using std::endl;
using std::cout;
namespace FGXMLAutopilot { namespace FGXMLAutopilot {
/* --------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------- */

View file

@ -24,6 +24,11 @@
#include "inputvalue.hxx" #include "inputvalue.hxx"
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::map;
using std::string;
using std::endl;
using std::cout;
namespace FGXMLAutopilot { namespace FGXMLAutopilot {
/** /**

View file

@ -25,6 +25,9 @@
using namespace FGXMLAutopilot; using namespace FGXMLAutopilot;
using std::endl;
using std::cout;
PIDController::PIDController(): PIDController::PIDController():
AnalogComponent(), AnalogComponent(),
alpha( 0.1 ), alpha( 0.1 ),

View file

@ -25,6 +25,9 @@
using namespace FGXMLAutopilot; using namespace FGXMLAutopilot;
using std::endl;
using std::cout;
PISimpleController::PISimpleController() : PISimpleController::PISimpleController() :
AnalogComponent(), AnalogComponent(),
_int_sum( 0.0 ) _int_sum( 0.0 )

View file

@ -25,6 +25,9 @@
using namespace FGXMLAutopilot; using namespace FGXMLAutopilot;
using std::endl;
using std::cout;
Predictor::Predictor () : Predictor::Predictor () :
AnalogComponent(), AnalogComponent(),
_average(0.0) _average(0.0)

View file

@ -71,6 +71,8 @@
// my hardware/driver requires many more. // my hardware/driver requires many more.
#define POFF_UNITS 8 #define POFF_UNITS 8
using std::map;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Local functions. // Local functions.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View file

@ -135,7 +135,7 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_
double c = abox->getDoubleValue("count", 5); double c = abox->getDoubleValue("count", 5);
int count = (int) (c + (sg_random() - 0.5) * c); int count = (int) (c + (sg_random() - 0.5) * c);
extent = max(w*w, extent); extent = std::max(w*w, extent);
for (int j = 0; j < count; j++) { for (int j = 0; j < count; j++) {

View file

@ -24,6 +24,7 @@
#endif #endif
#include "presets.hxx" #include "presets.hxx"
#include <cmath>
#include <simgear/math/SGMisc.hxx> #include <simgear/math/SGMisc.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>

View file

@ -330,7 +330,7 @@ void NoaaMetarRealWxController::requestMetar( MetarDataHandler * metarDataHandle
string reply; string reply;
if( name == "X-TIME" ) { if( name == "X-TIME" ) {
ostringstream buf; std::ostringstream buf;
buf << globals->get_time_params()->get_cur_time(); buf << globals->get_time_params()->get_cur_time();
reply = buf.str(); reply = buf.str();
} }

View file

@ -187,8 +187,8 @@ void FGRidgeLift::update(double dt) {
//boundaries //boundaries
double boundary2_m = 130.0; // in the lift double boundary2_m = 130.0; // in the lift
if (lift_factor < 0.0) { // in the sink if (lift_factor < 0.0) { // in the sink
double highest_probe_temp= max ( probe_elev_m[1], probe_elev_m[2] ); double highest_probe_temp= std::max ( probe_elev_m[1], probe_elev_m[2] );
double highest_probe_downwind_m= max ( highest_probe_temp, probe_elev_m[3] ); double highest_probe_downwind_m= std::max ( highest_probe_temp, probe_elev_m[3] );
boundary2_m = highest_probe_downwind_m - probe_elev_m[0]; boundary2_m = highest_probe_downwind_m - probe_elev_m[0];
} }
@ -199,7 +199,7 @@ void FGRidgeLift::update(double dt) {
agl_factor = 1.0; agl_factor = 1.0;
} else { } else {
agl_factor = exp(-(2 + probe_elev_m[0] / 2000) * agl_factor = exp(-(2 + probe_elev_m[0] / 2000) *
(user_altitude_agl_m - boundary2_m) / max(probe_elev_m[0],200.0)); (user_altitude_agl_m - boundary2_m) / std::max(probe_elev_m[0],200.0));
} }
double ground_wind_speed_mps = _surface_wind_speed_node->getDoubleValue() * SG_NM_TO_METER / 3600; double ground_wind_speed_mps = _surface_wind_speed_node->getDoubleValue() * SG_NM_TO_METER / 3600;

View file

@ -30,7 +30,12 @@
#include <deque> #include <deque>
#include "terrainsampler.hxx" #include "terrainsampler.hxx"
using simgear::PropertyList; using simgear::PropertyList;
using std::deque;
using std::vector;
using std::ostringstream;
using std::string;
#include <simgear/props/tiedpropertylist.hxx> #include <simgear/props/tiedpropertylist.hxx>

View file

@ -7,6 +7,9 @@
#include "Hitch.hpp" #include "Hitch.hpp"
using std::vector;
namespace yasim { namespace yasim {
Hitch::Hitch(const char *name) Hitch::Hitch(const char *name)
{ {

View file

@ -11,8 +11,6 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
using std::setprecision;
#ifdef TEST_DEBUG #ifdef TEST_DEBUG
#include <stdio.h> #include <stdio.h>
#endif #endif
@ -20,7 +18,8 @@ using std::setprecision;
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
using std::setprecision;
using std::endl;
namespace yasim { namespace yasim {
@ -732,7 +731,7 @@ void Rotor::setParameter(const char *parametername, float value)
p(rotor_correction_factor,1) p(rotor_correction_factor,1)
SG_LOG(SG_INPUT, SG_ALERT, SG_LOG(SG_INPUT, SG_ALERT,
"internal error in parameter set up for rotor: '" << "internal error in parameter set up for rotor: '" <<
parametername <<"'" << endl); parametername <<"'" << std::endl);
#undef p #undef p
} }

View file

@ -14,8 +14,9 @@
#include "new_gui.hxx" #include "new_gui.hxx"
#include "menubar.hxx" #include "menubar.hxx"
using std::vector;
using std::string;
using std::map;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// FIXME!! // FIXME!!
// //

View file

@ -7,17 +7,12 @@
# error This library requires C++ # error This library requires C++
#endif #endif
#include <simgear/compiler.h> // for SG_USING_STD
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <plib/pu.h> #include <plib/pu.h>
#include <map> #include <map>
using std::map;
#include <vector> #include <vector>
using std::vector;
class puMenuBar; class puMenuBar;
class puObject; class puObject;
@ -124,7 +119,7 @@ private:
puMenuBar * _menuBar; puMenuBar * _menuBar;
// A map of bindings for the menubar. // A map of bindings for the menubar.
map<string,vector<SGBinding *> > _bindings; std::map<std::string,std::vector<SGBinding *> > _bindings;
// These are hoops that we have to jump through because PUI doesn't // These are hoops that we have to jump through because PUI doesn't
// do memory management for lists. We have to allocate the arrays, // do memory management for lists. We have to allocate the arrays,
@ -132,11 +127,11 @@ private:
// freed. // freed.
char ** make_char_array (int size); char ** make_char_array (int size);
puCallback * make_callback_array (int size); puCallback * make_callback_array (int size);
vector<char **> _char_arrays; std::vector<char **> _char_arrays;
vector<puCallback *> _callback_arrays; std::vector<puCallback *> _callback_arrays;
// A map for {menu node path}->puObject translation. // A map for {menu node path}->puObject translation.
map<string, puObject *> _objects; std::map<std::string, puObject *> _objects;
}; };
#endif // __MENUBAR_HXX #endif // __MENUBAR_HXX

View file

@ -32,9 +32,9 @@
extern puFont FONT_HELVETICA_14; extern puFont FONT_HELVETICA_14;
extern puFont FONT_SANS_12B; extern puFont FONT_SANS_12B;
using std::map;
using std::string;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Implementation of NewGUI. // Implementation of NewGUI.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View file

@ -212,9 +212,10 @@ private:
}; };
puFont *_font; puFont *_font;
map<const char*,FGColor*, ltstr> _colors; typedef std::map<const char*,FGColor*, ltstr> ColourDict;
typedef map<const char*,FGColor*, ltstr>::iterator _itt_t; ColourDict _colors;
typedef map<const char*,FGColor*, ltstr>::const_iterator _citt_t; typedef ColourDict::iterator _itt_t;
typedef ColourDict::const_iterator _citt_t;
void clear_colors(); void clear_colors();
@ -311,8 +312,8 @@ private:
// Path to the font directory // Path to the font directory
SGPath _path; SGPath _path;
typedef map<const string, fntTexFont*> TexFontMap; typedef std::map<const std::string, fntTexFont*> TexFontMap;
typedef map<const FntParams, fnt*, FntParamsLess> PuFontMap; typedef std::map<const FntParams, fnt*, FntParamsLess> PuFontMap;
TexFontMap _texFonts; TexFontMap _texFonts;
PuFontMap _puFonts; PuFontMap _puFonts;

View file

@ -31,8 +31,10 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <string> #include <string>
using std::string; using std::string;
using std::cout; using std::cout;
using std::endl;
typedef string stdString; // puObject has a "string" member typedef string stdString; // puObject has a "string" member
@ -95,7 +97,7 @@ static void dumpProperties(const SGPropertyNode *node)
case props::VEC3D: case props::VEC3D:
case props::VEC4D: case props::VEC4D:
{ {
streamsize precision = cout.precision(15); std::streamsize precision = cout.precision(15);
c->printOn(cout); c->printOn(cout);
cout.precision(precision); cout.precision(precision);
} }

View file

@ -33,6 +33,7 @@
#include <simgear/math/SGMath.hxx> #include <simgear/math/SGMath.hxx>
using simgear::PropertyList; using simgear::PropertyList;
using std::string;
void FGCommonInput::read_bindings (const SGPropertyNode * node, binding_list_t * binding_list, int modifiers, const string & module ) void FGCommonInput::read_bindings (const SGPropertyNode * node, binding_list_t * binding_list, int modifiers, const string & module )
{ {

View file

@ -32,6 +32,8 @@
#include <Scripting/NasalSys.hxx> #include <Scripting/NasalSys.hxx>
using simgear::PropertyList; using simgear::PropertyList;
using std::cout;
using std::endl;
FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) : FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
value(0.0) value(0.0)

View file

@ -24,6 +24,9 @@
#define __FGEVENTINPUT_HXX #define __FGEVENTINPUT_HXX
#include "FGCommonInput.hxx" #include "FGCommonInput.hxx"
#include <vector>
#include "FGButton.hxx" #include "FGButton.hxx"
#include "FGDeviceConfigurationMap.hxx" #include "FGDeviceConfigurationMap.hxx"
#include <simgear/structure/subsystem_mgr.hxx> #include <simgear/structure/subsystem_mgr.hxx>
@ -57,7 +60,7 @@ protected:
}; };
typedef SGSharedPtr<FGEventSetting> FGEventSetting_ptr; typedef SGSharedPtr<FGEventSetting> FGEventSetting_ptr;
typedef vector<FGEventSetting_ptr> setting_list_t; typedef std::vector<FGEventSetting_ptr> setting_list_t;
/* /*
* A wrapper class for a configured event. * A wrapper class for a configured event.
@ -99,12 +102,12 @@ public:
/* /*
* access for the name property * access for the name property
*/ */
string GetName() const { return name; } std::string GetName() const { return name; }
/* /*
* access for the description property * access for the description property
*/ */
string GetDescription() const { return desc; } std::string GetDescription() const { return desc; }
virtual void update( double dt ); virtual void update( double dt );
@ -113,10 +116,10 @@ public:
protected: protected:
virtual void fire( SGBinding * binding, FGEventData & eventData ); virtual void fire( SGBinding * binding, FGEventData & eventData );
/* A more or less meaningfull description of the event */ /* A more or less meaningfull description of the event */
string desc; std::string desc;
/* One of the predefined names of the event */ /* One of the predefined names of the event */
string name; std::string name;
/* A list of SGBinding objects */ /* A list of SGBinding objects */
binding_list_t bindings[KEYMOD_MAX]; binding_list_t bindings[KEYMOD_MAX];
@ -184,7 +187,7 @@ typedef class SGSharedPtr<FGInputEvent> FGInputEvent_ptr;
class FGInputDevice : public SGReferenced { class FGInputDevice : public SGReferenced {
public: public:
FGInputDevice() : debugEvents(false), grab(false) {} FGInputDevice() : debugEvents(false), grab(false) {}
FGInputDevice( string aName ) : name(aName) {} FGInputDevice( std::string aName ) : name(aName) {}
virtual ~FGInputDevice(); virtual ~FGInputDevice();
@ -193,15 +196,15 @@ public:
virtual void Send( const char * eventName, double value ) = 0; virtual void Send( const char * eventName, double value ) = 0;
inline void Send( const string & eventName, double value ) { inline void Send( const std::string & eventName, double value ) {
Send( eventName.c_str(), value ); Send( eventName.c_str(), value );
} }
virtual const char * TranslateEventName( FGEventData & eventData ) = 0; virtual const char * TranslateEventName( FGEventData & eventData ) = 0;
void SetName( string name ); void SetName( std::string name );
string & GetName() { return name; } std::string & GetName() { return name; }
void HandleEvent( FGEventData & eventData ); void HandleEvent( FGEventData & eventData );
@ -218,14 +221,14 @@ public:
bool GetGrab() const { return grab; } bool GetGrab() const { return grab; }
const string & GetNasalModule() const { return nasalModule; } const std::string & GetNasalModule() const { return nasalModule; }
private: private:
// A map of events, this device handles // A map of events, this device handles
map<string,FGInputEvent_ptr> handledEvents; std::map<std::string,FGInputEvent_ptr> handledEvents;
// the device has a name to be recognized // the device has a name to be recognized
string name; std::string name;
// print out events comming in from the device // print out events comming in from the device
// if true // if true
@ -236,7 +239,7 @@ private:
bool grab; bool grab;
SGPropertyNode_ptr deviceNode; SGPropertyNode_ptr deviceNode;
string nasalModule; std::string nasalModule;
}; };
typedef SGSharedPtr<FGInputDevice> FGInputDevice_ptr; typedef SGSharedPtr<FGInputDevice> FGInputDevice_ptr;
@ -261,7 +264,7 @@ protected:
unsigned AddDevice( FGInputDevice * inputDevice ); unsigned AddDevice( FGInputDevice * inputDevice );
void RemoveDevice( unsigned index ); void RemoveDevice( unsigned index );
map<int,FGInputDevice*> input_devices; std::map<int,FGInputDevice*> input_devices;
FGDeviceConfigurationMap configMap; FGDeviceConfigurationMap configMap;
SGPropertyNode_ptr nasalClose; SGPropertyNode_ptr nasalClose;

View file

@ -193,7 +193,7 @@ void FGJoystickInput::postinit()
// //
// Initialize nasal groups. // Initialize nasal groups.
// //
ostringstream str; std::ostringstream str;
str << "__js" << i; str << "__js" << i;
string module = str.str(); string module = str.str();
nasalsys->createModule(module.c_str(), module.c_str(), "", 0); nasalsys->createModule(module.c_str(), module.c_str(), "", 0);

View file

@ -22,6 +22,9 @@
#include "FGMacOSXEventInput.hxx" #include "FGMacOSXEventInput.hxx"
using std::stringstream;
using std::map;
using std::string;
#define GetHIDElementLongValue(element, key) ({ \ #define GetHIDElementLongValue(element, key) ({ \
long value = 0; \ long value = 0; \
@ -612,7 +615,7 @@ void FGMacOSXInputDevice::Open() {
if (ret != kIOReturnSuccess) { if (ret != kIOReturnSuccess) {
SG_LOG(SG_INPUT, SG_ALERT, "Error creating a plugin for HID : " << GetName()); SG_LOG(SG_INPUT, SG_ALERT, "Error creating a plugin for HID : " << GetName());
throw exception(); throw std::exception();
return; return;
} }
@ -626,14 +629,14 @@ void FGMacOSXInputDevice::Open() {
(*plugin)->Release(plugin); // don't leak a ref (*plugin)->Release(plugin); // don't leak a ref
if (devInterface == NULL) { if (devInterface == NULL) {
return; return;
throw exception(); throw std::exception();
} }
// store the interface in this instance // store the interface in this instance
ret = (*devInterface)->open(devInterface, 0); ret = (*devInterface)->open(devInterface, 0);
if (ret != kIOReturnSuccess) { if (ret != kIOReturnSuccess) {
SG_LOG(SG_INPUT, SG_ALERT, "Error opening device interface: " << GetName()); SG_LOG(SG_INPUT, SG_ALERT, "Error opening device interface: " << GetName());
throw exception(); throw std::exception();
return; return;
} }
CFDictionaryRef props = getProperties(); CFDictionaryRef props = getProperties();

View file

@ -68,9 +68,9 @@ typedef enum {
class HIDElement; class HIDElement;
struct FGMacOSXEventData : public FGEventData { struct FGMacOSXEventData : public FGEventData {
FGMacOSXEventData(string name, double value, double dt, int modifiers) : FGMacOSXEventData(std::string name, double value, double dt, int modifiers) :
FGEventData(value, dt, modifiers), name(name) {} FGEventData(value, dt, modifiers), name(name) {}
string name; std::string name;
}; };
// //
@ -92,7 +92,7 @@ public:
HIDElement(CFDictionaryRef element, long page, long usage); HIDElement(CFDictionaryRef element, long page, long usage);
virtual ~HIDElement() {} virtual ~HIDElement() {}
bool isUpdated(); bool isUpdated();
string getName() { return name; } std::string getName() { return name; }
virtual void generateEvent(FGMacOSXInputDevice *device, double dt, int modifiers); virtual void generateEvent(FGMacOSXInputDevice *device, double dt, int modifiers);
virtual long read(IOHIDDeviceInterface **interface); virtual long read(IOHIDDeviceInterface **interface);
virtual void write(IOHIDDeviceInterface **interface, double value) { virtual void write(IOHIDDeviceInterface **interface, double value) {
@ -106,7 +106,7 @@ protected:
float value; float value;
float lastValue; float lastValue;
string name; std::string name;
}; };
class AxisElement : public HIDElement { class AxisElement : public HIDElement {
@ -182,7 +182,7 @@ public:
private: private:
io_object_t device; io_object_t device;
IOHIDDeviceInterface **devInterface; IOHIDDeviceInterface **devInterface;
map<string, HIDElement *> elements; // maps eventName and its relevant element for Send() std::map<std::string, HIDElement *> elements; // maps eventName and its relevant element for Send()
}; };
// //
@ -225,22 +225,22 @@ private:
io_iterator_t removedIterator; io_iterator_t removedIterator;
// maps FG device property ID (i.e. /input/events/device[ID]) with io_object for detaching devices // maps FG device property ID (i.e. /input/events/device[ID]) with io_object for detaching devices
map<io_object_t, unsigned> deviceIndices; std::map<io_object_t, unsigned> deviceIndices;
}; };
// //
// For obtaining event name and type from both HID element page and usage // For obtaining event name and type from both HID element page and usage
// //
class HIDTypeByID : public map<long, pair<HIDUsageType, const char *>*> { class HIDTypeByID : public std::map<long, std::pair<HIDUsageType, const char *>*> {
public: public:
HIDTypeByID(struct HIDTypes *table) { HIDTypeByID(struct HIDTypes *table) {
for( int i = 0; table[i].key!= -1; i++ ) for( int i = 0; table[i].key!= -1; i++ )
(*this)[table[i].key] = new pair<HIDUsageType, const char *>(table[i].type, table[i].eventName); (*this)[table[i].key] = new std::pair<HIDUsageType, const char *>(table[i].type, table[i].eventName);
} }
~HIDTypeByID() { ~HIDTypeByID() {
map<long, pair<HIDUsageType, const char *>*>::iterator it; std::map<long, std::pair<HIDUsageType, const char *>*>::iterator it;
for (it = this->begin(); it != this->end(); it++) { for (it = this->begin(); it != this->end(); it++) {
delete (*it).second; delete (*it).second;
} }
@ -249,7 +249,7 @@ public:
// key = (HID_element_page) << 16 | HID_element_usage) // key = (HID_element_page) << 16 | HID_element_usage)
const char *getName(long key) { const char *getName(long key) {
pair<HIDUsageType, const char *> *usageType = (*this)[key]; std::pair<HIDUsageType, const char *> *usageType = (*this)[key];
if (usageType == NULL) { if (usageType == NULL) {
return ""; return "";
} else { } else {
@ -258,7 +258,7 @@ public:
} }
const HIDUsageType getType(long key) { const HIDUsageType getType(long key) {
pair<HIDUsageType, const char *> *usageType = (*this)[key]; std::pair<HIDUsageType, const char *> *usageType = (*this)[key];
if (usageType == NULL) { if (usageType == NULL) {
return kHIDUsageNotSupported; return kHIDUsageNotSupported;
} else { } else {

View file

@ -25,6 +25,8 @@
#include "FGMouseInput.hxx" #include "FGMouseInput.hxx"
#include "Main/globals.hxx" #include "Main/globals.hxx"
using std::ios_base;
void ActivePickCallbacks::init( int b, const osgGA::GUIEventAdapter* ea ) void ActivePickCallbacks::init( int b, const osgGA::GUIEventAdapter* ea )
{ {
// Get the list of hit callbacks. Take the first callback that // Get the list of hit callbacks. Take the first callback that

View file

@ -40,6 +40,8 @@
#include "HUD.hxx" #include "HUD.hxx"
using std::endl;
using std::ifstream;
static float clamp(float f) static float clamp(float f)
{ {

View file

@ -52,6 +52,7 @@
#include <Airports/simple.hxx> #include <Airports/simple.hxx>
using std::cout; using std::cout;
using std::string;
// Command callbacks for FlightGear // Command callbacks for FlightGear

View file

@ -68,10 +68,10 @@ const char* KLN89TimeCodes[20] = { "UTC", "GST", "GDT", "ATS", "ATD", "EST", "ED
*/ */
// Used for storing airport town and county mapped by ID, since currently FG does not store this // Used for storing airport town and county mapped by ID, since currently FG does not store this
typedef map<string, string> airport_id_str_map_type; typedef std::map<std::string, std::string> airport_id_str_map_type;
typedef airport_id_str_map_type::iterator airport_id_str_map_iterator; typedef airport_id_str_map_type::iterator airport_id_str_map_iterator;
typedef vector<KLN89Page*> kln89_page_list_type; typedef std::vector<KLN89Page*> kln89_page_list_type;
typedef kln89_page_list_type::iterator kln89_page_list_itr; typedef kln89_page_list_type::iterator kln89_page_list_itr;
class KLN89 : public DCLGPS { class KLN89 : public DCLGPS {
@ -150,14 +150,14 @@ private:
void ToggleOBSMode(); void ToggleOBSMode();
// Initiate Direct To operation to the supplied ID. // Initiate Direct To operation to the supplied ID.
void DtoInitiate(const string& id); void DtoInitiate(const std::string& id);
//----------------------- Drawing functions which take CHARACTER units ------------------------- //----------------------- Drawing functions which take CHARACTER units -------------------------
// Render string s in display field field at position x, y // Render string s in display field field at position x, y
// WHERE POSITION IS IN CHARACTER UNITS! // WHERE POSITION IS IN CHARACTER UNITS!
// zero y at bottom? // zero y at bottom?
// invert: -1 => no inversion, 0 -> n => 1 char - s[invert] gets inverted, 99 => entire string gets inverted // invert: -1 => no inversion, 0 -> n => 1 char - s[invert] gets inverted, 99 => entire string gets inverted
void DrawText(const string& s, int field, int px, int py, bool bold = false, int invert = -1); void DrawText(const std::string& s, int field, int px, int py, bool bold = false, int invert = -1);
void DrawLatitude(double d, int field, int px, int py); void DrawLatitude(double d, int field, int px, int py);
void DrawLongitude(double d, int field, int px, int py); void DrawLongitude(double d, int field, int px, int py);
@ -307,7 +307,7 @@ private:
// Draw an airport or waypoint label on the moving map // Draw an airport or waypoint label on the moving map
// Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label. // Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label.
// The black background quad will automatically overlap this by 1 pixel. // The black background quad will automatically overlap this by 1 pixel.
void DrawLabel(const string& s, int x1, int y1, bool right_align = false); void DrawLabel(const std::string& s, int x1, int y1, bool right_align = false);
int GetLabelQuadrant(double h); int GetLabelQuadrant(double h);
int GetLabelQuadrant(double h1, double h2); int GetLabelQuadrant(double h1, double h2);
@ -316,7 +316,7 @@ private:
void DrawLine(int x1, int y1, int x2, int y2); void DrawLine(int x1, int y1, int x2, int y2);
// Draw normal sized text on the moving map // Draw normal sized text on the moving map
void DrawMapText(const string& s, int x, int y, bool draw_background = false); void DrawMapText(const std::string& s, int x, int y, bool draw_background = false);
void DrawMapUpArrow(int x, int y); void DrawMapUpArrow(int x, int y);

View file

@ -24,6 +24,8 @@
#include "kln89_page.hxx" #include "kln89_page.hxx"
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::string;
KLN89Page::KLN89Page(KLN89* parent) { KLN89Page::KLN89Page(KLN89* parent) {
_kln89 = parent; _kln89 = parent;
_entInvert = false; _entInvert = false;

View file

@ -65,21 +65,21 @@ public:
inline void SetEntInvert(bool b) { _entInvert = b; } inline void SetEntInvert(bool b) { _entInvert = b; }
// Get / Set a waypoint id, NOT the page name! // Get / Set a waypoint id, NOT the page name!
virtual void SetId(const string& s); virtual void SetId(const std::string& s);
virtual const string& GetId(); virtual const std::string& GetId();
inline int GetSubPage() { return(_subPage); } inline int GetSubPage() { return(_subPage); }
void SetSubPage(int n); void SetSubPage(int n);
inline int GetNSubPages() { return(_nSubPages); } inline int GetNSubPages() { return(_nSubPages); }
inline const string& GetName() { return(_name); } inline const std::string& GetName() { return(_name); }
protected: protected:
KLN89* _kln89; KLN89* _kln89;
string _name; // eg. "APT", "NAV" etc std::string _name; // eg. "APT", "NAV" etc
int _nSubPages; int _nSubPages;
// _subpage is zero based // _subpage is zero based
int _subPage; // The subpage gets remembered when other pages are displayed int _subPage; // The subpage gets remembered when other pages are displayed
@ -97,18 +97,18 @@ protected:
// Invert ID and display ENT in field 1 // Invert ID and display ENT in field 1
bool _entInvert; bool _entInvert;
string _id; // The ID of the waypoint that the page is displaying. std::string _id; // The ID of the waypoint that the page is displaying.
// Doesn't make sense for all pages, but does for all the data pages. // Doesn't make sense for all pages, but does for all the data pages.
void ShowScratchpadMessage(const string& line1, const string& line2); void ShowScratchpadMessage(const std::string& line1, const std::string& line2);
bool _scratchpadMsg; // Set true when there is a scratchpad message to display bool _scratchpadMsg; // Set true when there is a scratchpad message to display
double _scratchpadTimer; // Used for displaying the scratchpad messages for the right amount of time. double _scratchpadTimer; // Used for displaying the scratchpad messages for the right amount of time.
string _scratchpadLine1; std::string _scratchpadLine1;
string _scratchpadLine2; std::string _scratchpadLine2;
// TODO - remove this function from this class and use a built in method instead. // TODO - remove this function from this class and use a built in method instead.
string GPSitoa(int n); std::string GPSitoa(int n);
}; };
#endif // _KLN89_PAGE_HXX #endif // _KLN89_PAGE_HXX

View file

@ -25,6 +25,8 @@
#include "kln89_page_alt.hxx" #include "kln89_page_alt.hxx"
using std::string;
KLN89AltPage::KLN89AltPage(KLN89* parent) KLN89AltPage::KLN89AltPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 2; _nSubPages = 2;

View file

@ -29,7 +29,7 @@
class FGRunway; class FGRunway;
struct AptFreq { struct AptFreq {
string service; std::string service;
unsigned short int freq; unsigned short int freq;
}; };
@ -49,15 +49,15 @@ public:
void Knob2Left1(); void Knob2Left1();
void Knob2Right1(); void Knob2Right1();
void SetId(const string& s); void SetId(const std::string& s);
private: private:
// Update the cached airport details // Update the cached airport details
void UpdateAirport(const string& id); void UpdateAirport(const std::string& id);
string _apt_id; std::string _apt_id;
string _last_apt_id; std::string _last_apt_id;
string _save_apt_id; std::string _save_apt_id;
const FGAirport* ap; const FGAirport* ap;
vector<FGRunway*> _aptRwys; vector<FGRunway*> _aptRwys;

View file

@ -28,6 +28,8 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include "kln89_page_cal.hxx" #include "kln89_page_cal.hxx"
using std::string;
KLN89CalPage::KLN89CalPage(KLN89* parent) KLN89CalPage::KLN89CalPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 8; _nSubPages = 8;

View file

@ -28,6 +28,8 @@
#include "kln89_page_dir.hxx" #include "kln89_page_dir.hxx"
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::string;
KLN89DirPage::KLN89DirPage(KLN89* parent) KLN89DirPage::KLN89DirPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 1; _nSubPages = 1;

View file

@ -34,7 +34,7 @@ public:
void Update(double dt); void Update(double dt);
void SetId(const string& s); void SetId(const std::string& s);
void CrsrPressed(); void CrsrPressed();
void ClrPressed(); void ClrPressed();

View file

@ -48,7 +48,7 @@ public:
// Override the base class GetId function to return the waypoint ID under the cursor // Override the base class GetId function to return the waypoint ID under the cursor
// on FPL0 page, if there is one and the cursor is on. // on FPL0 page, if there is one and the cursor is on.
// Otherwise return an empty string. // Otherwise return an empty string.
inline const string& GetId() { return(_fp0SelWpId); } inline const std::string& GetId() { return(_fp0SelWpId); }
private: private:
int _fpMode; // 0 = Dis, 1 = Dtk int _fpMode; // 0 = Dis, 1 = Dtk
@ -56,7 +56,7 @@ private:
bool _bEntWp; // set true when a waypoint is being entered bool _bEntWp; // set true when a waypoint is being entered
bool _bEntExp; // Set true when ent is expected to set the currently entered waypoint as entered. bool _bEntExp; // Set true when ent is expected to set the currently entered waypoint as entered.
string _entWpStr; // The currently entered wp ID (need not be valid) std::string _entWpStr; // The currently entered wp ID (need not be valid)
GPSWaypoint* _entWp; // Waypoint being currently entered GPSWaypoint* _entWp; // Waypoint being currently entered
// The position of the cursor in a waypoint being entered // The position of the cursor in a waypoint being entered
@ -83,9 +83,9 @@ private:
void Calc(); void Calc();
// The ID of the waypoint under the cursor in fpl0, if those conditions exist! // The ID of the waypoint under the cursor in fpl0, if those conditions exist!
string _fp0SelWpId; std::string _fp0SelWpId;
vector<string> _params; std::vector<std::string> _params;
}; };
#endif // _KLN89_PAGE_FPL_HXX #endif // _KLN89_PAGE_FPL_HXX

View file

@ -29,6 +29,8 @@
#include <Navaids/fix.hxx> #include <Navaids/fix.hxx>
#include <Navaids/navrecord.hxx> #include <Navaids/navrecord.hxx>
using std::string;
KLN89IntPage::KLN89IntPage(KLN89* parent) KLN89IntPage::KLN89IntPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 2; _nSubPages = 2;

View file

@ -42,12 +42,12 @@ public:
void Knob2Left1(); void Knob2Left1();
void Knob2Right1(); void Knob2Right1();
void SetId(const string& s); void SetId(const std::string& s);
private: private:
string _int_id; std::string _int_id;
string _last_int_id; std::string _last_int_id;
string _save_int_id; std::string _save_int_id;
const FGFix* _fp; const FGFix* _fp;
FGNavRecord* _nearestVor; FGNavRecord* _nearestVor;
FGNavRecord* _refNav; // Will usually be the same as _nearestVor, and gets reset to _nearestVor when page looses focus. FGNavRecord* _refNav; // Will usually be the same as _nearestVor, and gets reset to _nearestVor when page looses focus.

View file

@ -28,6 +28,8 @@
#include "kln89_page_nav.hxx" #include "kln89_page_nav.hxx"
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
using std::string;
KLN89NavPage::KLN89NavPage(KLN89* parent) KLN89NavPage::KLN89NavPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 4; _nSubPages = 4;

View file

@ -42,7 +42,7 @@ public:
void LooseFocus(); void LooseFocus();
// Returns the id string of the selected waypoint on NAV4 if valid, else returns an empty string. // Returns the id string of the selected waypoint on NAV4 if valid, else returns an empty string.
string GetNav4WpId(); std::string GetNav4WpId();
private: private:
int _posFormat; // 0 => lat,lon; 1 => ref to wp. int _posFormat; // 0 => lat,lon; 1 => ref to wp.

View file

@ -28,6 +28,8 @@
#include "kln89_page_ndb.hxx" #include "kln89_page_ndb.hxx"
#include <Navaids/navrecord.hxx> #include <Navaids/navrecord.hxx>
using std::string;
KLN89NDBPage::KLN89NDBPage(KLN89* parent) KLN89NDBPage::KLN89NDBPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 2; _nSubPages = 2;

View file

@ -40,12 +40,12 @@ public:
void Knob2Left1(); void Knob2Left1();
void Knob2Right1(); void Knob2Right1();
void SetId(const string& s); void SetId(const std::string& s);
private: private:
string _ndb_id; std::string _ndb_id;
string _last_ndb_id; std::string _last_ndb_id;
string _save_ndb_id; std::string _save_ndb_id;
FGNavRecord* np; FGNavRecord* np;
}; };

View file

@ -27,6 +27,8 @@
#include "kln89_page_oth.hxx" #include "kln89_page_oth.hxx"
using std::string;
KLN89OthPage::KLN89OthPage(KLN89* parent) KLN89OthPage::KLN89OthPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 12; _nSubPages = 12;

View file

@ -28,6 +28,8 @@
#include "kln89_page_vor.hxx" #include "kln89_page_vor.hxx"
#include <Navaids/navrecord.hxx> #include <Navaids/navrecord.hxx>
using std::string;
KLN89VorPage::KLN89VorPage(KLN89* parent) KLN89VorPage::KLN89VorPage(KLN89* parent)
: KLN89Page(parent) { : KLN89Page(parent) {
_nSubPages = 2; _nSubPages = 2;

View file

@ -40,12 +40,12 @@ public:
void Knob2Left1(); void Knob2Left1();
void Knob2Right1(); void Knob2Right1();
void SetId(const string& s); void SetId(const std::string& s);
private: private:
string _vor_id; std::string _vor_id;
string _last_vor_id; std::string _last_vor_id;
string _save_vor_id; std::string _save_vor_id;
FGNavRecord* np; FGNavRecord* np;
}; };

View file

@ -62,7 +62,7 @@ public:
virtual void update(double dt); virtual void update(double dt);
protected: protected:
string _name; std::string _name;
int _num; int _num;
double _time; double _time;
double _updateInterval; double _updateInterval;
@ -110,7 +110,7 @@ private:
void updateFont(); void updateFont();
string _texture_path; std::string _texture_path;
float _scale; // factor to convert nm to display units float _scale; // factor to convert nm to display units

View file

@ -63,7 +63,7 @@ private:
void search (double frequency, double longitude_rad, void search (double frequency, double longitude_rad,
double latitude_rad, double altitude_m); double latitude_rad, double altitude_m);
string _name; std::string _name;
unsigned int _num; unsigned int _num;
SGPropertyNode_ptr _longitude_node; SGPropertyNode_ptr _longitude_node;

View file

@ -45,7 +45,7 @@ public:
private: private:
void computeMach(double ias); void computeMach(double ias);
string _name; std::string _name;
unsigned int _num; unsigned int _num;
string _total_pressure; string _total_pressure;
string _static_pressure; string _static_pressure;

View file

@ -39,7 +39,7 @@ public:
private: private:
string _name; std::string _name;
int _num; int _num;
string _static_pressure; string _static_pressure;
double _tau; double _tau;

View file

@ -18,6 +18,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/util.hxx> #include <Main/util.hxx>
using std::string;
AttitudeIndicator::AttitudeIndicator ( SGPropertyNode *node ) AttitudeIndicator::AttitudeIndicator ( SGPropertyNode *node )
: :

View file

@ -51,9 +51,9 @@ public:
private: private:
string _name; std::string _name;
int _num; int _num;
string _suction; std::string _suction;
Gyro _gyro; Gyro _gyro;

View file

@ -37,7 +37,7 @@ Clock::~Clock ()
void void
Clock::init () Clock::init ()
{ {
string branch; std::string branch;
branch = "/instrumentation/" + _name; branch = "/instrumentation/" + _name;
SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );

View file

@ -35,7 +35,7 @@ public:
virtual void update(double dt); virtual void update(double dt);
private: private:
string _name; std::string _name;
unsigned int _num; unsigned int _num;
bool _is_serviceable; bool _is_serviceable;

View file

@ -68,7 +68,7 @@ enum GPSAppWpType {
GPS_APP_NONE // Not part of the approach sequence - the default. GPS_APP_NONE // Not part of the approach sequence - the default.
}; };
ostream& operator << (ostream& os, GPSAppWpType type); std::ostream& operator << (std::ostream& os, GPSAppWpType type);
struct GPSWaypoint { struct GPSWaypoint {
GPSWaypoint(); GPSWaypoint();
@ -78,23 +78,23 @@ struct GPSWaypoint {
static GPSWaypoint* createFromPositioned(const FGPositioned* aFix); static GPSWaypoint* createFromPositioned(const FGPositioned* aFix);
~GPSWaypoint(); ~GPSWaypoint();
string GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc) std::string GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc)
string id; std::string id;
float lat; // Radians float lat; // Radians
float lon; // Radians float lon; // Radians
GPSWpType type; GPSWpType type;
GPSAppWpType appType; // only used for waypoints that are part of an approach sequence GPSAppWpType appType; // only used for waypoints that are part of an approach sequence
}; };
typedef vector < GPSWaypoint* > gps_waypoint_array; typedef std::vector < GPSWaypoint* > gps_waypoint_array;
typedef gps_waypoint_array::iterator gps_waypoint_array_iterator; typedef gps_waypoint_array::iterator gps_waypoint_array_iterator;
typedef map < string, gps_waypoint_array > gps_waypoint_map; typedef std::map < std::string, gps_waypoint_array > gps_waypoint_map;
typedef gps_waypoint_map::iterator gps_waypoint_map_iterator; typedef gps_waypoint_map::iterator gps_waypoint_map_iterator;
typedef gps_waypoint_map::const_iterator gps_waypoint_map_const_iterator; typedef gps_waypoint_map::const_iterator gps_waypoint_map_const_iterator;
class GPSFlightPlan { class GPSFlightPlan {
public: public:
vector<GPSWaypoint*> waypoints; std::vector<GPSWaypoint*> waypoints;
inline bool IsEmpty() { return(waypoints.size() == 0); } inline bool IsEmpty() { return(waypoints.size() == 0); }
}; };
@ -106,10 +106,10 @@ public:
virtual ~FGIAP() = 0; virtual ~FGIAP() = 0;
//protected: //protected:
string _aptIdent; // The ident of the airport this approach is for std::string _aptIdent; // The ident of the airport this approach is for
string _ident; // The approach ident. std::string _ident; // The approach ident.
string _name; // The full approach name. std::string _name; // The full approach name.
string _rwyStr; // The string used to specify the rwy - eg "B" in this instance. std::string _rwyStr; // The string used to specify the rwy - eg "B" in this instance.
bool _precision; // True for precision approach, false for non-precision. bool _precision; // True for precision approach, false for non-precision.
}; };
@ -120,14 +120,14 @@ public:
~FGNPIAP(); ~FGNPIAP();
//private: //private:
public: public:
vector<GPSFlightPlan*> _approachRoutes; // The approach route(s) from the IAF(s) to the IF. std::vector<GPSFlightPlan*> _approachRoutes; // The approach route(s) from the IAF(s) to the IF.
// NOTE: It is an assumption in the code that uses this that there is a unique IAF per approach route. // NOTE: It is an assumption in the code that uses this that there is a unique IAF per approach route.
vector<GPSWaypoint*> _IAP; // The compulsory waypoints of the approach procedure (may duplicate one of the above). std::vector<GPSWaypoint*> _IAP; // The compulsory waypoints of the approach procedure (may duplicate one of the above).
// _IAP includes the FAF and MAF, and the missed approach waypoints. // _IAP includes the FAF and MAF, and the missed approach waypoints.
}; };
typedef vector < FGIAP* > iap_list_type; typedef std::vector < FGIAP* > iap_list_type;
typedef map < string, iap_list_type > iap_map_type; typedef std::map < std::string, iap_list_type > iap_map_type;
typedef iap_map_type::iterator iap_map_iterator; typedef iap_map_type::iterator iap_map_iterator;
// A class to encapsulate hr:min representation of time. // A class to encapsulate hr:min representation of time.
@ -157,7 +157,7 @@ public:
ClockTime t2(diff / 60, diff % 60); ClockTime t2(diff / 60, diff % 60);
return(t2); return(t2);
} }
friend ostream& operator<< (ostream& out, const ClockTime& t); friend std::ostream& operator<< (std::ostream& out, const ClockTime& t);
private: private:
int _hr; int _hr;
@ -181,12 +181,12 @@ public:
virtual void update(double dt); virtual void update(double dt);
// Expand a SIAP ident to the full procedure name. // Expand a SIAP ident to the full procedure name.
string ExpandSIAPIdent(const string& ident); std::string ExpandSIAPIdent(const std::string& ident);
// Render string s in display field field at position x, y // Render string s in display field field at position x, y
// WHERE POSITION IS IN CHARACTER UNITS! // WHERE POSITION IS IN CHARACTER UNITS!
// zero y at bottom? // zero y at bottom?
virtual void DrawText(const string& s, int field, int px, int py, bool bold = false); virtual void DrawText(const std::string& s, int field, int px, int py, bool bold = false);
// Render a char at a given position as above // Render a char at a given position as above
virtual void DrawChar(char c, int field, int px, int py, bool bold = false); virtual void DrawChar(char c, int field, int px, int py, bool bold = false);
@ -214,7 +214,7 @@ public:
// Returns -1 if no active waypoint. // Returns -1 if no active waypoint.
int GetActiveWaypointIndex(); int GetActiveWaypointIndex();
// Ditto for an arbitrary waypoint id // Ditto for an arbitrary waypoint id
int GetWaypointIndex(const string& id); int GetWaypointIndex(const std::string& id);
// Returns meters // Returns meters
float GetDistToActiveWaypoint(); float GetDistToActiveWaypoint();
@ -232,7 +232,7 @@ public:
// returns -1 if groundspeed is less than 30kts. // returns -1 if groundspeed is less than 30kts.
// If the waypoint is an unreached part of the active flight plan the time will be via each leg. // If the waypoint is an unreached part of the active flight plan the time will be via each leg.
// otherwise it will be a direct-to time. // otherwise it will be a direct-to time.
double GetTimeToWaypoint(const string& id); double GetTimeToWaypoint(const std::string& id);
// Return true if waypoint alerting is occuring // Return true if waypoint alerting is occuring
inline bool GetWaypointAlert() const { return(_waypointAlert); } inline bool GetWaypointAlert() const { return(_waypointAlert); }
@ -253,7 +253,7 @@ public:
inline bool GetToFlag() const { return(_headingBugTo); } inline bool GetToFlag() const { return(_headingBugTo); }
// Initiate Direct To operation to the supplied ID. // Initiate Direct To operation to the supplied ID.
virtual void DtoInitiate(const string& id); virtual void DtoInitiate(const std::string& id);
// Cancel Direct To operation // Cancel Direct To operation
void DtoCancel(); void DtoCancel();
@ -286,7 +286,7 @@ protected:
// CDI full-scale deflection, specified either as an index into a vector of values (standard values) or as a double precision float (intermediate values). // CDI full-scale deflection, specified either as an index into a vector of values (standard values) or as a double precision float (intermediate values).
// This will influence how an externally driven CDI will display as well as the NAV1 page. // This will influence how an externally driven CDI will display as well as the NAV1 page.
// Hence the variables are located here, not in the nav page class. // Hence the variables are located here, not in the nav page class.
vector<float> _cdiScales; std::vector<float> _cdiScales;
unsigned int _currentCdiScaleIndex; unsigned int _currentCdiScaleIndex;
bool _cdiScaleTransition; // Set true when the floating CDI value is used during transitions bool _cdiScaleTransition; // Set true when the floating CDI value is used during transitions
double _currentCdiScale; // The floating value to use. double _currentCdiScale; // The floating value to use.
@ -305,13 +305,13 @@ protected:
void LoadApproachData(); void LoadApproachData();
// Find first of any type of waypoint by id. (TODO - Possibly we should return multiple waypoints here). // Find first of any type of waypoint by id. (TODO - Possibly we should return multiple waypoints here).
GPSWaypoint* FindFirstById(const string& id) const; GPSWaypoint* FindFirstById(const std::string& id) const;
GPSWaypoint* FindFirstByExactId(const string& id) const; GPSWaypoint* FindFirstByExactId(const std::string& id) const;
FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false); FGNavRecord* FindFirstVorById(const std::string& id, bool &multi, bool exact = false);
FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false); FGNavRecord* FindFirstNDBById(const std::string& id, bool &multi, bool exact = false);
const FGAirport* FindFirstAptById(const string& id, bool &multi, bool exact = false); const FGAirport* FindFirstAptById(const std::string& id, bool &multi, bool exact = false);
const FGFix* FindFirstIntById(const string& id, bool &multi, bool exact = false); const FGFix* FindFirstIntById(const std::string& id, bool &multi, bool exact = false);
// Find the closest VOR to a position in RADIANS. // Find the closest VOR to a position in RADIANS.
FGNavRecord* FindClosestVor(double lat_rad, double lon_rad); FGNavRecord* FindClosestVor(double lat_rad, double lon_rad);
@ -388,7 +388,7 @@ protected:
// Flightplans // Flightplans
// GPS can have up to _maxFlightPlans flightplans stored, PLUS an active FP which may or my not be one of the stored ones. // GPS can have up to _maxFlightPlans flightplans stored, PLUS an active FP which may or my not be one of the stored ones.
// This is from KLN89, but is probably not far off the mark for most if not all GPS. // This is from KLN89, but is probably not far off the mark for most if not all GPS.
vector<GPSFlightPlan*> _flightPlans; std::vector<GPSFlightPlan*> _flightPlans;
unsigned int _maxFlightPlans; unsigned int _maxFlightPlans;
GPSFlightPlan* _activeFP; GPSFlightPlan* _activeFP;
@ -414,7 +414,7 @@ protected:
bool _headingBugTo; // Set true when the heading bug is TO, false when FROM. bool _headingBugTo; // Set true when the heading bug is TO, false when FROM.
bool _waypointAlert; // Set true when waypoint alerting is happening. (This is a variable NOT a user-setting). bool _waypointAlert; // Set true when waypoint alerting is happening. (This is a variable NOT a user-setting).
bool _departed; // Set when groundspeed first exceeds 30kts. bool _departed; // Set when groundspeed first exceeds 30kts.
string _departureTimeString; // Ditto. std::string _departureTimeString; // Ditto.
double _elapsedTime; // Elapsed time in seconds since departure double _elapsedTime; // Elapsed time in seconds since departure
ClockTime _powerOnTime; // Time (hr:min) of unit power-up. ClockTime _powerOnTime; // Time (hr:min) of unit power-up.
bool _powerOnTimerSet; // Indicates that we have set the above following power-up. bool _powerOnTimerSet; // Indicates that we have set the above following power-up.
@ -437,9 +437,9 @@ protected:
// Magvar stuff. Might get some of this stuff (such as time) from FG in future. // Magvar stuff. Might get some of this stuff (such as time) from FG in future.
SGTime* _time; SGTime* _time;
list<string> _messageStack; std::list<std::string> _messageStack;
virtual void CreateFlightPlan(GPSFlightPlan* fp, vector<string> ids, vector<GPSWpType> wps); virtual void CreateFlightPlan(GPSFlightPlan* fp, std::vector<std::string> ids, std::vector<GPSWpType> wps);
// Orientate the GPS unit to a flightplan - ie. figure out from current position // Orientate the GPS unit to a flightplan - ie. figure out from current position
// and possibly orientation which leg of the FP we are on. // and possibly orientation which leg of the FP we are on.
@ -460,10 +460,10 @@ protected:
// the scale change, but it's in the manual... // the scale change, but it's in the manual...
bool _approachActive; // Set true when in approach-active mode bool _approachActive; // Set true when in approach-active mode
GPSFlightPlan* _approachFP; // Current approach - not necessarily loaded. GPSFlightPlan* _approachFP; // Current approach - not necessarily loaded.
string _approachID; // ID of the airport we have an approach loaded for - bit of a hack that can hopefully be removed in future. std::string _approachID; // ID of the airport we have an approach loaded for - bit of a hack that can hopefully be removed in future.
// More hackery since we aren't actually storing an approach class... Doh! // More hackery since we aren't actually storing an approach class... Doh!
string _approachAbbrev; std::string _approachAbbrev;
string _approachRwyStr; std::string _approachRwyStr;
}; };
#endif // _DCLGPS_HXX #endif // _DCLGPS_HXX

View file

@ -61,7 +61,7 @@ private:
FGNavRecord * _navrecord; FGNavRecord * _navrecord;
string _name; std::string _name;
int _num; int _num;
class AudioIdent * _audioIdent; class AudioIdent * _audioIdent;

View file

@ -49,7 +49,7 @@ GSDI::~GSDI()
void GSDI::init() void GSDI::init()
{ {
string branch; std::string branch;
branch = "/instrumentation/" + _name; branch = "/instrumentation/" + _name;
SGPropertyNode *n = fgGetNode(branch.c_str(), _num, true); SGPropertyNode *n = fgGetNode(branch.c_str(), _num, true);
_serviceableN = n->getNode("serviceable", true); _serviceableN = n->getNode("serviceable", true);

View file

@ -51,7 +51,7 @@ public:
virtual void update(double dt); virtual void update(double dt);
private: private:
string _name; std::string _name;
unsigned int _num; unsigned int _num;
SGPropertyNode_ptr _serviceableN; SGPropertyNode_ptr _serviceableN;

View file

@ -29,7 +29,7 @@ HeadingIndicator::~HeadingIndicator ()
void void
HeadingIndicator::init () HeadingIndicator::init ()
{ {
string branch; std::string branch;
branch = "/instrumentation/" + _name; branch = "/instrumentation/" + _name;
SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
@ -47,7 +47,7 @@ void
HeadingIndicator::bind () HeadingIndicator::bind ()
{ {
std::ostringstream temp; std::ostringstream temp;
string branch; std::string branch;
temp << _num; temp << _num;
branch = "/instrumentation/" + _name + "[" + temp.str() + "]"; branch = "/instrumentation/" + _name + "[" + temp.str() + "]";
@ -61,7 +61,7 @@ void
HeadingIndicator::unbind () HeadingIndicator::unbind ()
{ {
std::ostringstream temp; std::ostringstream temp;
string branch; std::string branch;
temp << _num; temp << _num;
branch = "/instrumentation/" + _name + "[" + temp.str() + "]"; branch = "/instrumentation/" + _name + "[" + temp.str() + "]";

View file

@ -51,9 +51,9 @@ private:
Gyro _gyro; Gyro _gyro;
double _last_heading_deg; double _last_heading_deg;
string _name; std::string _name;
int _num; int _num;
string _suction; std::string _suction;
SGPropertyNode_ptr _offset_node; SGPropertyNode_ptr _offset_node;
SGPropertyNode_ptr _heading_in_node; SGPropertyNode_ptr _heading_in_node;

View file

@ -25,8 +25,8 @@ HeadingIndicatorDG::HeadingIndicatorDG ( SGPropertyNode *node ) :
int i; int i;
for ( i = 0; i < node->nChildren(); ++i ) { for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i); SGPropertyNode *child = node->getChild(i);
string cname = child->getName(); std::string cname = child->getName();
string cval = child->getStringValue(); std::string cval = child->getStringValue();
if ( cname == "name" ) { if ( cname == "name" ) {
name = cval; name = cval;
} else if ( cname == "number" ) { } else if ( cname == "number" ) {
@ -51,7 +51,7 @@ HeadingIndicatorDG::~HeadingIndicatorDG ()
void void
HeadingIndicatorDG::init () HeadingIndicatorDG::init ()
{ {
string branch; std::string branch;
branch = "/instrumentation/" + name; branch = "/instrumentation/" + name;
_heading_in_node = fgGetNode("/orientation/heading-deg", true); _heading_in_node = fgGetNode("/orientation/heading-deg", true);
@ -81,7 +81,7 @@ void
HeadingIndicatorDG::bind () HeadingIndicatorDG::bind ()
{ {
std::ostringstream temp; std::ostringstream temp;
string branch; std::string branch;
temp << num; temp << num;
branch = "/instrumentation/" + name + "[" + temp.str() + "]"; branch = "/instrumentation/" + name + "[" + temp.str() + "]";
@ -95,7 +95,7 @@ void
HeadingIndicatorDG::unbind () HeadingIndicatorDG::unbind ()
{ {
std::ostringstream temp; std::ostringstream temp;
string branch; std::string branch;
temp << num; temp << num;
branch = "/instrumentation/" + name + "[" + temp.str() + "]"; branch = "/instrumentation/" + name + "[" + temp.str() + "]";

View file

@ -49,7 +49,7 @@ private:
Gyro _gyro; Gyro _gyro;
double _last_heading_deg; double _last_heading_deg;
string name; std::string name;
int num; int num;
//string vacuum_system; //string vacuum_system;

View file

@ -14,6 +14,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/util.hxx> #include <Main/util.hxx>
using std::string;
HeadingIndicatorFG::HeadingIndicatorFG ( SGPropertyNode *node ) HeadingIndicatorFG::HeadingIndicatorFG ( SGPropertyNode *node )
: :

View file

@ -51,7 +51,7 @@ private:
Gyro _gyro; Gyro _gyro;
double _last_heading_deg; double _last_heading_deg;
string name; std::string name;
int num; int num;
SGPropertyNode_ptr _offset_node; SGPropertyNode_ptr _offset_node;

View file

@ -62,7 +62,7 @@ public:
private: private:
string _name; std::string _name;
int _num; int _num;
double _internal_pressure_inhg; double _internal_pressure_inhg;

View file

@ -43,8 +43,8 @@ class FGKR_87 : public SGSubsystem
bool need_update; bool need_update;
// internal values // internal values
string ident; std::string ident;
string trans_ident; std::string trans_ident;
bool valid; bool valid;
bool inrange; bool inrange;
double stn_lon; double stn_lon;
@ -115,7 +115,7 @@ public:
void search (); void search ();
// internal values // internal values
inline const string& get_ident() const { return ident; } inline const std::string& get_ident() const { return ident; }
inline bool get_valid() const { return valid; } inline bool get_valid() const { return valid; }
inline bool get_inrange() const { return inrange; } inline bool get_inrange() const { return inrange; }
inline double get_stn_lon() const { return stn_lon; } inline double get_stn_lon() const { return stn_lon; }

View file

@ -32,7 +32,7 @@ MagCompass::~MagCompass ()
void void
MagCompass::init () MagCompass::init ()
{ {
string branch; std::string branch;
branch = "/instrumentation/" + _name; branch = "/instrumentation/" + _name;
SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );

View file

@ -51,7 +51,7 @@ private:
double _error_deg; double _error_deg;
double _rate_degps; double _rate_degps;
string _name; std::string _name;
int _num; int _num;
SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _serviceable_node;

View file

@ -22,6 +22,8 @@
const double MasterReferenceGyro::gravity = -32.1740485564; const double MasterReferenceGyro::gravity = -32.1740485564;
using std::string;
MasterReferenceGyro::MasterReferenceGyro ( SGPropertyNode *node ) : MasterReferenceGyro::MasterReferenceGyro ( SGPropertyNode *node ) :
_name(node->getStringValue("name", "master-reference-gyro")), _name(node->getStringValue("name", "master-reference-gyro")),
_num(node->getIntValue("number", 0)) _num(node->getIntValue("number", 0))

View file

@ -51,7 +51,7 @@ private:
static const double gravity; //conversion factor static const double gravity; //conversion factor
string _name; std::string _name;
int _num; int _num;
double _last_roll; double _last_roll;

View file

@ -137,7 +137,7 @@ class FGNavRadio : public SGSubsystem, public SGPropertyChangeListener
double xrate_ms; double xrate_ms;
double _localizerWidth; // cached localizer width in degrees double _localizerWidth; // cached localizer width in degrees
string _name; std::string _name;
int _num; int _num;
// internal periodic station search timer // internal periodic station search timer

View file

@ -808,7 +808,7 @@ public:
void valueChanged (SGPropertyNode * prop) void valueChanged (SGPropertyNode * prop)
{ {
// format as fixed decimal "nnn.nn" // format as fixed decimal "nnn.nn"
ostringstream buf; std::ostringstream buf;
buf << std::fixed buf << std::fixed
<< std::setw(5) << std::setw(5)
<< std::setfill('0') << std::setfill('0')
@ -922,7 +922,7 @@ void NavRadioImpl::update( double dt )
try { try {
position = globals->get_aircraft_position(); position = globals->get_aircraft_position();
} }
catch( exception & ) { catch( std::exception & ) {
return; return;
} }

View file

@ -7,6 +7,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/util.hxx> #include <Main/util.hxx>
using std::string;
SlipSkidBall::SlipSkidBall ( SGPropertyNode *node) SlipSkidBall::SlipSkidBall ( SGPropertyNode *node)
: :

View file

@ -43,7 +43,7 @@ private:
double _last_pos; double _last_pos;
string _name; std::string _name;
int _num; int _num;
SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _serviceable_node;

View file

@ -18,7 +18,7 @@
#include "tacan.hxx" #include "tacan.hxx"
using std::vector; using std::vector;
using std::string;
/** /**
* Adjust the range. * Adjust the range.

View file

@ -46,10 +46,10 @@ private:
void search (double frequency, double longitude_rad, void search (double frequency, double longitude_rad,
double latitude_rad, double altitude_m); double latitude_rad, double altitude_m);
double searchChannel (const string& channel); double searchChannel (const std::string& channel);
void valueChanged (SGPropertyNode *); void valueChanged (SGPropertyNode *);
string _name; std::string _name;
unsigned int _num; unsigned int _num;
SGPropertyNode_ptr _longitude_node; SGPropertyNode_ptr _longitude_node;
@ -85,7 +85,7 @@ private:
SGPropertyNode_ptr _mp_callsign_node; // FIXME SGPropertyNode_ptr _mp_callsign_node; // FIXME
bool _new_frequency; bool _new_frequency;
string _channel; std::string _channel;
double _last_distance_nm; double _last_distance_nm;
double _frequency_mhz; double _frequency_mhz;
double _time_before_search_sec; double _time_before_search_sec;
@ -98,16 +98,16 @@ private:
double _transmitter_range_nm; double _transmitter_range_nm;
double _transmitter_bearing_deg; double _transmitter_bearing_deg;
double _transmitter_bias; double _transmitter_bias;
string _transmitter_name; std::string _transmitter_name;
string _transmitter_ident; std::string _transmitter_ident;
double _mobile_lat, _mobile_lon; double _mobile_lat, _mobile_lon;
double _mobile_elevation_ft; double _mobile_elevation_ft;
double _mobile_range_nm; double _mobile_range_nm;
double _mobile_bearing_deg; double _mobile_bearing_deg;
double _mobile_bias; double _mobile_bias;
string _mobile_name; std::string _mobile_name;
string _mobile_ident; std::string _mobile_ident;
int _listener_active; int _listener_active;
}; };

View file

@ -24,6 +24,8 @@
#include "transponder.hxx" #include "transponder.hxx"
using std::string;
Transponder::Transponder(SGPropertyNode *node) Transponder::Transponder(SGPropertyNode *node)
: :
_name(node->getStringValue("name", "transponder")), _name(node->getStringValue("name", "transponder")),

View file

@ -50,9 +50,9 @@ private:
SGPropertyNode_ptr flightLevelNode; SGPropertyNode_ptr flightLevelNode;
// Internal // Internal
string _name; std::string _name;
int _num; int _num;
string _mode_c_altitude; std::string _mode_c_altitude;
}; };
#endif // TRANSPONDER_HXX #endif // TRANSPONDER_HXX

View file

@ -12,6 +12,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/util.hxx> #include <Main/util.hxx>
using std::string;
// Use a bigger number to be more responsive, or a smaller number // Use a bigger number to be more responsive, or a smaller number
// to be more sluggish. // to be more sluggish.

View file

@ -53,7 +53,7 @@ private:
Gyro _gyro; Gyro _gyro;
double _last_rate; double _last_rate;
string _name; std::string _name;
int _num; int _num;
SGPropertyNode_ptr _roll_rate_node; SGPropertyNode_ptr _roll_rate_node;

View file

@ -9,6 +9,7 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/util.hxx> #include <Main/util.hxx>
using std::string;
VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node ) VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node )
: _internal_pressure_inhg(29.92), : _internal_pressure_inhg(29.92),

View file

@ -42,9 +42,9 @@ private:
double _internal_pressure_inhg; double _internal_pressure_inhg;
string _name; std::string _name;
int _num; int _num;
string _static_pressure; std::string _static_pressure;
SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _serviceable_node;
SGPropertyNode_ptr _pressure_node; SGPropertyNode_ptr _pressure_node;

View file

@ -45,12 +45,14 @@
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
using std::stringstream; using std::stringstream;
using std::endl; using std::endl;
using std::setprecision; using std::setprecision;
using std::fixed; using std::fixed;
using std::setw; using std::setw;
using std::setfill; using std::setfill;
using std::string;
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>

View file

@ -51,7 +51,7 @@ public:
virtual void valueChanged(SGPropertyNode *); virtual void valueChanged(SGPropertyNode *);
protected: protected:
string _name; std::string _name;
int _num; int _num;
double _time; double _time;
double _interval; double _interval;
@ -90,7 +90,7 @@ protected:
SGPropertyNode *getInstrumentNode(const char *name, DefaultType value); SGPropertyNode *getInstrumentNode(const char *name, DefaultType value);
private: private:
string _texture_path; std::string _texture_path;
typedef enum { ARC, MAP, PLAN, ROSE, BSCAN} DisplayMode; typedef enum { ARC, MAP, PLAN, ROSE, BSCAN} DisplayMode;
DisplayMode _display_mode; DisplayMode _display_mode;

View file

@ -420,7 +420,7 @@ extern const char * fgGetString (const char * name,
* @return The property's value as a string, or the default value provided. * @return The property's value as a string, or the default value provided.
*/ */
inline const char * fgGetString (const std::string & name, inline const char * fgGetString (const std::string & name,
const std::string & defaultValue = string("")) const std::string & defaultValue = std::string(""))
{ {
return fgGetString( name.c_str(), defaultValue.c_str() ); return fgGetString( name.c_str(), defaultValue.c_str() );
} }

View file

@ -38,7 +38,7 @@ FGLogger::init ()
if (logging == 0) if (logging == 0)
return; return;
vector<SGPropertyNode_ptr> children = logging->getChildren("log"); std::vector<SGPropertyNode_ptr> children = logging->getChildren("log");
for (unsigned int i = 0; i < children.size(); i++) { for (unsigned int i = 0; i < children.size(); i++) {
SGPropertyNode * child = children[i]; SGPropertyNode * child = children[i];
@ -64,7 +64,7 @@ FGLogger::init ()
log.interval_ms = child->getLongValue("interval-ms"); log.interval_ms = child->getLongValue("interval-ms");
log.last_time_ms = globals->get_sim_time_sec() * 1000; log.last_time_ms = globals->get_sim_time_sec() * 1000;
log.delimiter = delimiter.c_str()[0]; log.delimiter = delimiter.c_str()[0];
log.output = new ofstream(filename.c_str()); log.output = new std::ofstream(filename.c_str());
if (!log.output) { if (!log.output) {
SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename); SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename);
continue; continue;

View file

@ -587,7 +587,7 @@ int fgMainInit( int argc, char **argv ) {
#endif #endif
SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version " SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version "
<< version ); << version );
SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR << endl ); SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR << std::endl );
// Allocate global data structures. This needs to happen before // Allocate global data structures. This needs to happen before
// we parse command line options // we parse command line options

View file

@ -146,8 +146,8 @@ public:
char *genNameString() char *genNameString()
{ {
string website = "http://www.flightgear.org"; std::string website = "http://www.flightgear.org";
string programName = "FlightGear"; std::string programName = "FlightGear";
char *name = new char[26]; char *name = new char[26];
name[20] = 114; name[20] = 114;
name[8] = 119; name[8] = 119;

View file

@ -17,10 +17,10 @@
// //
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <math.h> #include <math.h>
@ -28,7 +28,6 @@
#include <cstdlib> #include <cstdlib>
#include <vector> #include <vector>
using std::vector;
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/math/SGLimits.hxx> #include <simgear/math/SGLimits.hxx>
@ -43,6 +42,8 @@ using std::vector;
#include "osgDB/Registry" #include "osgDB/Registry"
#endif #endif
using std::vector;
// Originally written by Alex Perry. // Originally written by Alex Perry.
double double
fgGetLowPass (double current, double target, double timeratio) fgGetLowPass (double current, double target, double timeratio)
@ -71,10 +72,10 @@ fgGetLowPass (double current, double target, double timeratio)
} }
string std::string
fgUnescape (const char *s) fgUnescape (const char *s)
{ {
string r; std::string r;
while (*s) { while (*s) {
if (*s != '\\') { if (*s != '\\') {
r += *s++; r += *s++;

View file

@ -288,7 +288,7 @@ FGViewMgr::unbind ()
fgUntie("/sim/current-view/viewer-y-m"); fgUntie("/sim/current-view/viewer-y-m");
fgUntie("/sim/current-view/viewer-z-m"); fgUntie("/sim/current-view/viewer-z-m");
list<const char*>::const_iterator it; std::list<const char*>::const_iterator it;
for (it = tied_props.begin(); it != tied_props.end(); it++){ for (it = tied_props.begin(); it != tied_props.end(); it++){
fgUntie(*it); fgUntie(*it);
} }

View file

@ -76,7 +76,7 @@ public:
private: private:
void do_bind(); void do_bind();
list<const char*> tied_props; std::list<const char*> tied_props;
double axis_long; double axis_long;
double axis_lat; double axis_lat;
@ -140,7 +140,7 @@ private:
bool inited; bool inited;
SGPropertyNode_ptr view_number; SGPropertyNode_ptr view_number;
vector<SGPropertyNode_ptr> config_list; std::vector<SGPropertyNode_ptr> config_list;
typedef std::vector<FGViewerPtr> viewer_list; typedef std::vector<FGViewerPtr> viewer_list;
viewer_list views; viewer_list views;
SGVec3d abs_viewer_position; SGVec3d abs_viewer_position;

Some files were not shown because too many files have changed in this diff Show more