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 _callsign;
string _submodel;
string _name;
std::string _name;
string _parent;
SGGeod userpos;

View file

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

View file

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

View file

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

View file

@ -51,6 +51,8 @@
#include <ATC/CommStation.hxx>
using std::vector;
using std::pair;
using namespace flightgear;
// 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()
{
cerr << "Deleting Airport" << endl;
delete _dynamics;
}
@ -552,7 +553,7 @@ FGAirport::selectSID(const SGGeod& aDest, FGRunway* aRwy)
<< (aRwy ? aRwy->ident() : "no runway preference"));
}
return make_pair(sid, enroute);
return std::make_pair(sid, enroute);
}
pair<STAR*, WayptRef>
@ -584,7 +585,7 @@ FGAirport::selectSTAR(const SGGeod& aOrigin, FGRunway* aRwy)
}
} // 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 )
{
SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" << endl );
SG_LOG( SG_AUTOPILOT, SG_BULK, "AnalogComponent::configure(" << nodeName << ")" );
if( Component::configure( nodeName, configNode ) )
return true;
@ -108,6 +108,6 @@ bool AnalogComponent::configure( const std::string & nodeName, SGPropertyNode_pt
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;
}

View file

@ -36,6 +36,9 @@
#include "Main/fg_props.hxx"
using std::map;
using std::string;
using namespace FGXMLAutopilot;
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);
string childName = node->getName();
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;
}
Component * component = (*componentForge[childName])(node);
if( component->get_name().length() == 0 ) {
ostringstream buf;
std::ostringstream buf;
buf << "unnamed_component_" << i;
component->set_name( buf.str() );
}
@ -96,7 +99,7 @@ void Autopilot::add_component( Component * component )
// check for duplicate name
std::string name = component->get_name();
for( unsigned i = 0; get_subsystem( name.c_str() ) != NULL; i++ ) {
ostringstream buf;
std::ostringstream buf;
buf << component->get_name() << "_" << i;
name = buf.str();
}

View file

@ -36,7 +36,8 @@
#include <simgear/structure/exception.hxx>
#include <Main/fg_props.hxx>
using std::vector;
using std::string;
using simgear::PropertyList;
class FGXMLAutopilotGroupImplementation : public FGXMLAutopilotGroup
@ -111,7 +112,7 @@ void FGXMLAutopilotGroupImplementation::initFrom( SGPropertyNode_ptr rootNode, c
// check for duplicate names
string name = apName;
for( unsigned i = 0; get_subsystem( apName.c_str() ) != NULL; i++ ) {
ostringstream buf;
std::ostringstream buf;
buf << name << "_" << i;
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 )
{
SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << endl );
SG_LOG( SG_AUTOPILOT, SG_BULK, "Component::configure(" << nodeName << ")" << std::endl );
if ( nodeName == "name" ) {
_name = configNode->getStringValue();
@ -97,7 +97,7 @@ bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr conf
return true;
} // 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;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -135,7 +135,7 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_
double c = abox->getDoubleValue("count", 5);
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++) {

View file

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

View file

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

View file

@ -187,8 +187,8 @@ void FGRidgeLift::update(double dt) {
//boundaries
double boundary2_m = 130.0; // in the lift
if (lift_factor < 0.0) { // in the sink
double highest_probe_temp= 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_temp= std::max ( probe_elev_m[1], probe_elev_m[2] );
double highest_probe_downwind_m= std::max ( highest_probe_temp, probe_elev_m[3] );
boundary2_m = highest_probe_downwind_m - probe_elev_m[0];
}
@ -199,7 +199,7 @@ void FGRidgeLift::update(double dt) {
agl_factor = 1.0;
} else {
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;

View file

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

View file

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

View file

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

View file

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

View file

@ -7,17 +7,12 @@
# error This library requires C++
#endif
#include <simgear/compiler.h> // for SG_USING_STD
#include <Main/fg_props.hxx>
#include <plib/pu.h>
#include <map>
using std::map;
#include <vector>
using std::vector;
class puMenuBar;
class puObject;
@ -124,7 +119,7 @@ private:
puMenuBar * _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
// do memory management for lists. We have to allocate the arrays,
@ -132,11 +127,11 @@ private:
// freed.
char ** make_char_array (int size);
puCallback * make_callback_array (int size);
vector<char **> _char_arrays;
vector<puCallback *> _callback_arrays;
std::vector<char **> _char_arrays;
std::vector<puCallback *> _callback_arrays;
// A map for {menu node path}->puObject translation.
map<string, puObject *> _objects;
std::map<std::string, puObject *> _objects;
};
#endif // __MENUBAR_HXX

View file

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

View file

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

View file

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

View file

@ -33,6 +33,7 @@
#include <simgear/math/SGMath.hxx>
using simgear::PropertyList;
using std::string;
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>
using simgear::PropertyList;
using std::cout;
using std::endl;
FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
value(0.0)

View file

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

View file

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

View file

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

View file

@ -68,9 +68,9 @@ typedef enum {
class HIDElement;
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) {}
string name;
std::string name;
};
//
@ -92,7 +92,7 @@ public:
HIDElement(CFDictionaryRef element, long page, long usage);
virtual ~HIDElement() {}
bool isUpdated();
string getName() { return name; }
std::string getName() { return name; }
virtual void generateEvent(FGMacOSXInputDevice *device, double dt, int modifiers);
virtual long read(IOHIDDeviceInterface **interface);
virtual void write(IOHIDDeviceInterface **interface, double value) {
@ -106,7 +106,7 @@ protected:
float value;
float lastValue;
string name;
std::string name;
};
class AxisElement : public HIDElement {
@ -182,7 +182,7 @@ public:
private:
io_object_t device;
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;
// 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
//
class HIDTypeByID : public map<long, pair<HIDUsageType, const char *>*> {
class HIDTypeByID : public std::map<long, std::pair<HIDUsageType, const char *>*> {
public:
HIDTypeByID(struct HIDTypes *table) {
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() {
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++) {
delete (*it).second;
}
@ -249,7 +249,7 @@ public:
// key = (HID_element_page) << 16 | HID_element_usage)
const char *getName(long key) {
pair<HIDUsageType, const char *> *usageType = (*this)[key];
std::pair<HIDUsageType, const char *> *usageType = (*this)[key];
if (usageType == NULL) {
return "";
} else {
@ -258,7 +258,7 @@ public:
}
const HIDUsageType getType(long key) {
pair<HIDUsageType, const char *> *usageType = (*this)[key];
std::pair<HIDUsageType, const char *> *usageType = (*this)[key];
if (usageType == NULL) {
return kHIDUsageNotSupported;
} else {

View file

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

View file

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

View file

@ -52,6 +52,7 @@
#include <Airports/simple.hxx>
using std::cout;
using std::string;
// 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
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 vector<KLN89Page*> kln89_page_list_type;
typedef std::vector<KLN89Page*> kln89_page_list_type;
typedef kln89_page_list_type::iterator kln89_page_list_itr;
class KLN89 : public DCLGPS {
@ -150,14 +150,14 @@ private:
void ToggleOBSMode();
// 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 -------------------------
// Render string s in display field field at position x, y
// WHERE POSITION IS IN CHARACTER UNITS!
// zero y at bottom?
// 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 DrawLongitude(double d, int field, int px, int py);
@ -307,7 +307,7 @@ private:
// 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.
// 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 h1, double h2);
@ -316,7 +316,7 @@ private:
void DrawLine(int x1, int y1, int x2, int y2);
// 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);

View file

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

View file

@ -65,21 +65,21 @@ public:
inline void SetEntInvert(bool b) { _entInvert = b; }
// Get / Set a waypoint id, NOT the page name!
virtual void SetId(const string& s);
virtual const string& GetId();
virtual void SetId(const std::string& s);
virtual const std::string& GetId();
inline int GetSubPage() { return(_subPage); }
void SetSubPage(int n);
inline int GetNSubPages() { return(_nSubPages); }
inline const string& GetName() { return(_name); }
inline const std::string& GetName() { return(_name); }
protected:
KLN89* _kln89;
string _name; // eg. "APT", "NAV" etc
std::string _name; // eg. "APT", "NAV" etc
int _nSubPages;
// _subpage is zero based
int _subPage; // The subpage gets remembered when other pages are displayed
@ -97,18 +97,18 @@ protected:
// Invert ID and display ENT in field 1
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.
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
double _scratchpadTimer; // Used for displaying the scratchpad messages for the right amount of time.
string _scratchpadLine1;
string _scratchpadLine2;
std::string _scratchpadLine1;
std::string _scratchpadLine2;
// 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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -48,7 +48,7 @@ public:
// 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.
// Otherwise return an empty string.
inline const string& GetId() { return(_fp0SelWpId); }
inline const std::string& GetId() { return(_fp0SelWpId); }
private:
int _fpMode; // 0 = Dis, 1 = Dtk
@ -56,7 +56,7 @@ private:
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.
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
// The position of the cursor in a waypoint being entered
@ -83,9 +83,9 @@ private:
void Calc();
// 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

View file

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

View file

@ -42,12 +42,12 @@ public:
void Knob2Left1();
void Knob2Right1();
void SetId(const string& s);
void SetId(const std::string& s);
private:
string _int_id;
string _last_int_id;
string _save_int_id;
std::string _int_id;
std::string _last_int_id;
std::string _save_int_id;
const FGFix* _fp;
FGNavRecord* _nearestVor;
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 <Main/fg_props.hxx>
using std::string;
KLN89NavPage::KLN89NavPage(KLN89* parent)
: KLN89Page(parent) {
_nSubPages = 4;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -68,7 +68,7 @@ enum GPSAppWpType {
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 {
GPSWaypoint();
@ -78,23 +78,23 @@ struct GPSWaypoint {
static GPSWaypoint* createFromPositioned(const FGPositioned* aFix);
~GPSWaypoint();
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 GetAprId(); // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc)
std::string id;
float lat; // Radians
float lon; // Radians
GPSWpType type;
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 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::const_iterator gps_waypoint_map_const_iterator;
class GPSFlightPlan {
public:
vector<GPSWaypoint*> waypoints;
std::vector<GPSWaypoint*> waypoints;
inline bool IsEmpty() { return(waypoints.size() == 0); }
};
@ -106,10 +106,10 @@ public:
virtual ~FGIAP() = 0;
//protected:
string _aptIdent; // The ident of the airport this approach is for
string _ident; // The approach ident.
string _name; // The full approach name.
string _rwyStr; // The string used to specify the rwy - eg "B" in this instance.
std::string _aptIdent; // The ident of the airport this approach is for
std::string _ident; // The approach ident.
std::string _name; // The full approach name.
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.
};
@ -120,14 +120,14 @@ public:
~FGNPIAP();
//private:
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.
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.
};
typedef vector < FGIAP* > iap_list_type;
typedef map < string, iap_list_type > iap_map_type;
typedef std::vector < FGIAP* > iap_list_type;
typedef std::map < std::string, iap_list_type > iap_map_type;
typedef iap_map_type::iterator iap_map_iterator;
// A class to encapsulate hr:min representation of time.
@ -157,7 +157,7 @@ public:
ClockTime t2(diff / 60, diff % 60);
return(t2);
}
friend ostream& operator<< (ostream& out, const ClockTime& t);
friend std::ostream& operator<< (std::ostream& out, const ClockTime& t);
private:
int _hr;
@ -181,12 +181,12 @@ public:
virtual void update(double dt);
// 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
// WHERE POSITION IS IN CHARACTER UNITS!
// 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
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.
int GetActiveWaypointIndex();
// Ditto for an arbitrary waypoint id
int GetWaypointIndex(const string& id);
int GetWaypointIndex(const std::string& id);
// Returns meters
float GetDistToActiveWaypoint();
@ -232,7 +232,7 @@ public:
// 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.
// 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
inline bool GetWaypointAlert() const { return(_waypointAlert); }
@ -253,7 +253,7 @@ public:
inline bool GetToFlag() const { return(_headingBugTo); }
// 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
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).
// 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.
vector<float> _cdiScales;
std::vector<float> _cdiScales;
unsigned int _currentCdiScaleIndex;
bool _cdiScaleTransition; // Set true when the floating CDI value is used during transitions
double _currentCdiScale; // The floating value to use.
@ -305,13 +305,13 @@ protected:
void LoadApproachData();
// Find first of any type of waypoint by id. (TODO - Possibly we should return multiple waypoints here).
GPSWaypoint* FindFirstById(const string& id) const;
GPSWaypoint* FindFirstByExactId(const string& id) const;
GPSWaypoint* FindFirstById(const std::string& id) const;
GPSWaypoint* FindFirstByExactId(const std::string& id) const;
FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false);
FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false);
const FGAirport* FindFirstAptById(const string& id, bool &multi, bool exact = false);
const FGFix* FindFirstIntById(const string& id, bool &multi, bool exact = false);
FGNavRecord* FindFirstVorById(const std::string& id, bool &multi, bool exact = false);
FGNavRecord* FindFirstNDBById(const std::string& id, bool &multi, bool exact = false);
const FGAirport* FindFirstAptById(const std::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.
FGNavRecord* FindClosestVor(double lat_rad, double lon_rad);
@ -388,7 +388,7 @@ protected:
// Flightplans
// 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.
vector<GPSFlightPlan*> _flightPlans;
std::vector<GPSFlightPlan*> _flightPlans;
unsigned int _maxFlightPlans;
GPSFlightPlan* _activeFP;
@ -414,7 +414,7 @@ protected:
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 _departed; // Set when groundspeed first exceeds 30kts.
string _departureTimeString; // Ditto.
std::string _departureTimeString; // Ditto.
double _elapsedTime; // Elapsed time in seconds since departure
ClockTime _powerOnTime; // Time (hr:min) of unit 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.
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
// 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...
bool _approachActive; // Set true when in approach-active mode
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!
string _approachAbbrev;
string _approachRwyStr;
std::string _approachAbbrev;
std::string _approachRwyStr;
};
#endif // _DCLGPS_HXX

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -43,8 +43,8 @@ class FGKR_87 : public SGSubsystem
bool need_update;
// internal values
string ident;
string trans_ident;
std::string ident;
std::string trans_ident;
bool valid;
bool inrange;
double stn_lon;
@ -115,7 +115,7 @@ public:
void search ();
// 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_inrange() const { return inrange; }
inline double get_stn_lon() const { return stn_lon; }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -587,7 +587,7 @@ int fgMainInit( int argc, char **argv ) {
#endif
SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: 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
// we parse command line options

View file

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

View file

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

View file

@ -288,7 +288,7 @@ FGViewMgr::unbind ()
fgUntie("/sim/current-view/viewer-y-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++){
fgUntie(*it);
}

View file

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

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