1
0
Fork 0

Namespace fixes for std::string

This commit is contained in:
James Turner 2013-06-27 09:37:06 +01:00
parent 36896733d7
commit b1b6d2f6e2
17 changed files with 41 additions and 38 deletions

View file

@ -34,7 +34,7 @@ PISimpleController::PISimpleController() :
{
}
bool PISimpleController::configure( const string& nodeName, SGPropertyNode_ptr configNode)
bool PISimpleController::configure( const std::string& nodeName, SGPropertyNode_ptr configNode)
{
if( AnalogComponent::configure( nodeName, configNode ) )
return true;

View file

@ -34,7 +34,7 @@ Predictor::Predictor () :
{
}
bool Predictor::configure(const string& nodeName, SGPropertyNode_ptr configNode)
bool Predictor::configure(const std::string& nodeName, SGPropertyNode_ptr configNode)
{
SG_LOG( SG_AUTOPILOT, SG_BULK, "Predictor::configure(" << nodeName << ")" << endl );

View file

@ -221,7 +221,7 @@ void GroundRadar::updateTexture()
osg::ref_ptr<osg::Vec3Array> taxi_vertices = new osg::Vec3Array;
osg::ref_ptr<osg::Vec3Array> pvt_vertices = new osg::Vec3Array;
const string airport_name = _airport_node->getStringValue();
const std::string airport_name = _airport_node->getStringValue();
const FGAirport* airport = fgFindAirportID(airport_name);
if (airport == 0)

View file

@ -98,10 +98,10 @@ get_aspect_adjust (int xsize, int ysize)
// Implementation of FGTextureManager.
////////////////////////////////////////////////////////////////////////
map<string,osg::ref_ptr<osg::Texture2D> > FGTextureManager::_textureMap;
map<std::string,osg::ref_ptr<osg::Texture2D> > FGTextureManager::_textureMap;
osg::Texture2D*
FGTextureManager::createTexture (const string &relativePath, bool staticTexture)
FGTextureManager::createTexture (const std::string &relativePath, bool staticTexture)
{
osg::Texture2D* texture = _textureMap[relativePath].get();
if (texture == 0) {
@ -118,7 +118,7 @@ FGTextureManager::createTexture (const string &relativePath, bool staticTexture)
}
void FGTextureManager::addTexture(const string &relativePath,
void FGTextureManager::addTexture(const std::string &relativePath,
osg::Texture2D* texture)
{
_textureMap[relativePath] = texture;
@ -136,7 +136,7 @@ FGCroppedTexture::FGCroppedTexture ()
}
FGCroppedTexture::FGCroppedTexture (const string &path,
FGCroppedTexture::FGCroppedTexture (const std::string &path,
float minX, float minY,
float maxX, float maxY)
: _path(path), _texture(0),
@ -1135,7 +1135,7 @@ FGTextLayer::setPointSize (float size)
}
void
FGTextLayer::setFontName(const string &name)
FGTextLayer::setFontName(const std::string &name)
{
_font_name = name + ".txf";
FGFontCache *fc = globals->get_fontcache();
@ -1170,7 +1170,7 @@ FGTextLayer::recalc_value () const
// Implementation of FGTextLayer::Chunk.
////////////////////////////////////////////////////////////////////////
FGTextLayer::Chunk::Chunk (const string &text, const string &fmt)
FGTextLayer::Chunk::Chunk (const std::string &text, const std::string &fmt)
: _type(FGTextLayer::TEXT), _fmt(fmt)
{
_text = text;
@ -1179,7 +1179,7 @@ FGTextLayer::Chunk::Chunk (const string &text, const string &fmt)
}
FGTextLayer::Chunk::Chunk (ChunkType type, const SGPropertyNode * node,
const string &fmt, float mult, float offs,
const std::string &fmt, float mult, float offs,
bool truncation)
: _type(type), _fmt(fmt), _mult(mult), _offs(offs), _trunc(truncation)
{

View file

@ -373,7 +373,7 @@ FGMouseInput::~FGMouseInput()
void FGMouseInput::init()
{
SG_LOG(SG_INPUT, SG_DEBUG, "Initializing mouse bindings");
string module = "";
std::string module = "";
SGPropertyNode * mouse_nodes = fgGetNode("/input/mice");
if (mouse_nodes == 0) {

View file

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

View file

@ -50,7 +50,7 @@ private:
std::string _name;
int _num;
SGPropertyNode_ptr _rootNode;
string _static_pressure;
std::string _static_pressure;
double _tau;
double _quantum;
double _kollsman;

View file

@ -110,7 +110,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
{
for ( int i = 0; i < config_props->nChildren(); ++i ) {
SGPropertyNode *node = config_props->getChild(i);
string name = node->getName();
std::string name = node->getName();
std::ostringstream subsystemname;
subsystemname << "instrument-" << i << '-'
@ -118,7 +118,7 @@ bool FGInstrumentMgr::build (SGPropertyNode* config_props)
int index = node->getIntValue("number", 0);
if (index > 0)
subsystemname << '['<< index << ']';
string id = subsystemname.str();
std::string id = subsystemname.str();
if ( name == "adf" ) {
set_subsystem( id, new ADF( node ), 0.15 );

View file

@ -1329,7 +1329,7 @@ private:
// MK_VIII (continued) //////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
string name;
std::string name;
int num;
PowerHandler power_handler;

View file

@ -174,7 +174,7 @@ protected:
PropertyObject<double> _trackDistance_m;
PropertyObject<double> _slantDistance_m;
PropertyObject<double> _heightAboveStation_ft;
PropertyObject<string> _ident;
PropertyObject<std::string> _ident;
PropertyObject<bool> _inRange;
PropertyObject<double> _range_nm;
};
@ -378,7 +378,9 @@ double VOR::ServiceVolume::adjustRange( double height_ft, double nominalRange_nm
}
VOR::VOR( SGPropertyNode_ptr rootNode) :
NavRadioComponentWithIdent("vor", rootNode, new VORAudioIdent(getIdentString(string("vor"), rootNode->getIndex()))),
NavRadioComponentWithIdent("vor", rootNode,
new VORAudioIdent(getIdentString(std::string("vor"),
rootNode->getIndex()))),
_totalTime(0.0),
_radial( rootNode->getNode(_name,true)->getNode("radial",true) ),
_radialInbound( rootNode->getNode(_name,true)->getNode("radial-inbound",true) )
@ -523,7 +525,8 @@ double LOC::ServiceVolume::adjustRange( double azimuthAngle_deg, double elevatio
}
LOC::LOC( SGPropertyNode_ptr rootNode) :
NavRadioComponentWithIdent("loc", rootNode, new LOCAudioIdent(getIdentString(string("loc"), rootNode->getIndex()))),
NavRadioComponentWithIdent("loc", rootNode, new LOCAudioIdent(getIdentString(std::string("loc"),
rootNode->getIndex()))),
_serviceVolume(),
_localizerOffset_norm( rootNode->getNode(_name,true)->getNode("offset-norm",true) ),
_localizerWidth_deg( rootNode->getNode(_name,true)->getNode("width-deg",true) )
@ -882,7 +885,7 @@ NavRadioImpl::NavRadioImpl( SGPropertyNode_ptr node ) :
_legacy( this ),
_name(node->getStringValue("name", "nav")),
_num(node->getIntValue("number", 0)),
_rootNode(fgGetNode( string("/instrumentation/") + _name, _num, true)),
_rootNode(fgGetNode( std::string("/instrumentation/") + _name, _num, true)),
_useFrequencyFormatter( _rootNode->getNode("frequencies/selected-mhz",true), _rootNode->getNode("frequencies/selected-mhz-fmt",true), 0.05 ),
_stbyFrequencyFormatter( _rootNode->getNode("frequencies/standby-mhz",true), _rootNode->getNode("frequencies/standby-mhz-fmt",true), 0.05 ),
_navIndicator(_rootNode),
@ -968,7 +971,7 @@ void NavRadioImpl::Legacy::update( double dt )
_navRadioImpl->_components[VOR_COMPONENT]->valid() || _navRadioImpl->_components[LOC_COMPONENT]->valid()
);
string ident = _navRadioImpl->_components[VOR_COMPONENT]->getIdent();
std::string ident = _navRadioImpl->_components[VOR_COMPONENT]->getIdent();
if( ident.empty() )
ident = _navRadioImpl->_components[LOC_COMPONENT]->getIdent();

View file

@ -114,7 +114,7 @@ class TCAS : public SGSubsystem
typedef struct
{
string callsign;
std::string callsign;
bool verticalTA;
bool verticalRA;
bool horizontalTA;
@ -134,7 +134,7 @@ class TCAS : public SGSubsystem
double RAtimestamp;
} TrackerTarget;
typedef map<string,TrackerTarget*> TrackerTargets;
typedef map<std::string,TrackerTarget*> TrackerTargets;
typedef struct
{
@ -264,12 +264,12 @@ class TCAS : public SGSubsystem
void update (void);
void add (const string callsign, int detectedLevel);
void add (const std::string callsign, int detectedLevel);
bool active (void) { return haveTargets;}
bool newTraffic (void) { return newTargets;}
bool isTracked (string callsign) { if (!haveTargets) return false;else return _isTracked(callsign);}
bool _isTracked (string callsign);
int getThreatLevel (string callsign);
bool isTracked (std::string callsign) { if (!haveTargets) return false;else return _isTracked(callsign);}
bool _isTracked (std::string callsign);
int getThreatLevel (std::string callsign);
private:
TCAS* tcas;
@ -358,7 +358,7 @@ class TCAS : public SGSubsystem
};
private:
string name;
std::string name;
int num;
double nextUpdateTime;
int selfTestStep;

View file

@ -220,7 +220,7 @@ FGGlobals::~FGGlobals()
}
// set the fg_root path
void FGGlobals::set_fg_root (const string &root) {
void FGGlobals::set_fg_root (const std::string &root) {
SGPath tmp(root);
fg_root = tmp.realpath();
@ -247,12 +247,12 @@ void FGGlobals::set_fg_root (const string &root) {
}
// set the fg_home path
void FGGlobals::set_fg_home (const string &home) {
void FGGlobals::set_fg_home (const std::string &home) {
SGPath tmp(home);
fg_home = tmp.realpath();
}
void FGGlobals::append_fg_scenery (const string &paths)
void FGGlobals::append_fg_scenery (const std::string &paths)
{
// fg_scenery.clear();
SGPropertyNode* sim = fgGetNode("/sim", true);

View file

@ -301,7 +301,7 @@ int fgMainInit( int argc, char **argv ) {
// now home is initialised, we can log to a file inside it
logToFile();
string version;
std::string version;
#ifdef FLIGHTGEAR_VERSION
version = FLIGHTGEAR_VERSION;
#else

View file

@ -65,7 +65,7 @@ FGAircraftModel::init ()
osg::Node *model = NULL;
_aircraft = new SGModelPlacement;
string path = fgGetString("/sim/model/path", "Models/Geometry/glider.ac");
std::string path = fgGetString("/sim/model/path", "Models/Geometry/glider.ac");
SGPath resolvedPath = globals->resolve_aircraft_path(path);
if (resolvedPath.isNull())

View file

@ -179,7 +179,7 @@ void FGPanelNode::lazyLoad()
_panel = fgReadPanel(_panelPath);
if (!_panel) {
SG_LOG(SG_COCKPIT, SG_WARN, "failed to read panel from:" << _panelPath);
_panelPath = string(); // don't keep trying to read
_panelPath = std::string(); // don't keep trying to read
return;
}

View file

@ -132,8 +132,8 @@ void findAttrOrHex(const simgear::effect::EffectPropertyMap<T>& pMap,
try {
result = boost::lexical_cast<T>(val);
} catch (boost::bad_lexical_cast &) {
throw simgear::effect::BuilderException(string("findAttrOrHex: could not find attribute ")
+ string(val));
throw simgear::effect::BuilderException(std::string("findAttrOrHex: could not find attribute ")
+ std::string(val));
}
}
}

View file

@ -388,7 +388,7 @@ void fgSplashInit () {
void fgSplashProgress( const char *identifier ) {
const char* spinChars = "-\\|/";
static int spin_count = 0;
string spin_status = string("");
std::string spin_status = std::string("");
if (identifier[0] != 0)
spin_status += spinChars[spin_count++ % 4];
@ -398,7 +398,7 @@ void fgSplashProgress( const char *identifier ) {
const char* text = "";
if (identifier[0] != 0)
{
string id = string("splash/") + identifier;
std::string id = std::string("splash/") + identifier;
text = globals->get_locale()->getLocalizedString(id.c_str(),
"sys", "<incomplete language resource>");
}