1
0
Fork 0

Maintenance: namespace

Clean up namespaces.
Don't use broad 'using namespace' context in header files.
Header Guards.
SPDX tags.
This commit is contained in:
scttgs0 2023-05-20 17:36:08 -05:00
parent b2c3795f11
commit 7061fc6be9
11 changed files with 155 additions and 274 deletions

View file

@ -1,21 +1,9 @@
// soundmanager.cxx -- Wraps the SimGear OpenAl sound manager class
//
// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
/*
* SPDX-FileName: soundmanager.cxx
* SPDX-FileComment: Wraps the SimGear OpenAl sound manager class
* SPDX-FileCopyrightText: Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config.h>
@ -207,10 +195,10 @@ void FGSoundManager::update(double dt)
*/
bool FGSoundManager::playAudioSampleCommand(const SGPropertyNode * arg, SGPropertyNode * root)
{
string qname = arg->getStringValue("queue", "");
string name = !qname.empty() ? qname : "chatter";
string path = arg->getStringValue("path");
string file = arg->getStringValue("file");
std::string qname = arg->getStringValue("queue", "");
std::string name = !qname.empty() ? qname : "chatter";
std::string path = arg->getStringValue("path");
std::string file = arg->getStringValue("file");
float volume = arg->getFloatValue("volume");
const auto fullPath = SGPath(path) / file;
@ -231,7 +219,7 @@ bool FGSoundManager::playAudioSampleCommand(const SGPropertyNode * arg, SGProper
{
static const char *r = "0123456789abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string rstr = "NASAL: ";
std::string rstr = "NASAL: ";
for (int i=0; i<10; i++) {
rstr.push_back( r[rand() % strlen(r)] );
}

View file

@ -1,24 +1,9 @@
// speech synthesis interface subsystem
//
// Written by Melchior FRANZ, started February 2006.
//
// Copyright (C) 2006 Melchior FRANZ - mfranz@aon.at
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
/*
* SPDX-FileName: voice.cxx
* SPDX-FileComment: speech synthesis interface subsystem
* SPDX-FileCopyrightText: Copyright (C) 2006 Melchior FRANZ - mfranz@aon.at
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@ -85,7 +70,7 @@ void FGVoiceMgr::init()
#endif
SGPropertyNode *base = fgGetNode(VOICE, true);
vector<SGPropertyNode_ptr> voices = base->getChildren("voice");
std::vector<SGPropertyNode_ptr> voices = base->getChildren("voice");
for (unsigned int i = 0; i < voices.size(); i++) {
SGPropertyNode_ptr voice = voices[i];
if( voice->getBoolValue("festival", false ) ) {

View file

@ -1,24 +1,9 @@
// electrical.cxx - a flexible, generic electrical system model.
//
// Written by Curtis Olson, started September 2002.
//
// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
/*
* SPDX-FileName: electrical.cxx
* SPDX-FileComment: a flexible, generic electrical system model
* SPDX-FileCopyrightText: Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
@ -66,7 +51,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
// cout << "Creating a supplier" << endl;
name = node->getStringValue("name");
string _model = node->getStringValue("kind");
std::string _model = node->getStringValue("kind");
// cout << "_model = " << _model << endl;
if ( _model == "battery" ) {
model = FG_BATTERY;
@ -91,7 +76,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
SGPropertyNode *child = node->getChild(i);
// cout << " scanning: " << child->getName() << endl;
if ( child->getNameString() == "prop" ) {
string prop = child->getStringValue();
std::string prop = child->getStringValue();
// cout << " Adding prop = " << prop << endl;
add_prop( prop );
fgSetFloat( prop.c_str(), ideal_amps );
@ -210,7 +195,7 @@ FGElectricalBus::FGElectricalBus ( SGPropertyNode *node ) {
for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i);
if ( child->getNameString() == "prop" ) {
string prop = child->getStringValue();
std::string prop = child->getStringValue();
add_prop( prop );
}
}
@ -232,7 +217,7 @@ FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) {
for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i);
if ( child->getNameString() == "prop" ) {
string prop = child->getStringValue();
std::string prop = child->getStringValue();
add_prop( prop );
}
}
@ -248,8 +233,8 @@ FGElectricalSwitch::FGElectricalSwitch( SGPropertyNode *node ) :
int i;
for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i);
string cname = child->getNameString();
string cval = child->getStringValue();
std::string cname = child->getNameString();
std::string cval = child->getStringValue();
if ( cname == "prop" ) {
switch_node = fgGetNode( cval.c_str(), true );
// cout << "switch node = " << cval << endl;
@ -277,8 +262,8 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node,
int i;
for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i);
string cname = child->getNameString();
string cval = child->getStringValue();
std::string cname = child->getNameString();
std::string cval = child->getStringValue();
// cout << " " << cname << " = " << cval << endl;
if ( cname == "input" ) {
FGElectricalComponent *s = es->find( child->getStringValue() );
@ -600,7 +585,7 @@ bool FGElectricalSystem::build (SGPropertyNode* config_props) {
int count = config_props->nChildren();
for ( i = 0; i < count; ++i ) {
node = config_props->getChild(i);
string name = node->getNameString();
std::string name = node->getNameString();
// cout << name << endl;
if ( name == "supplier" ) {
FGElectricalSupplier *s =
@ -633,7 +618,7 @@ bool FGElectricalSystem::build (SGPropertyNode* config_props) {
// total current drawn by the children of this node.
float FGElectricalSystem::propagate( FGElectricalComponent *node, double dt,
float input_volts, float input_amps,
string s ) {
std::string s ) {
s += " ";
float total_load = 0.0;
@ -725,9 +710,9 @@ float FGElectricalSystem::propagate( FGElectricalComponent *node, double dt,
// search for the named component and return a pointer to it, NULL otherwise
FGElectricalComponent *FGElectricalSystem::find ( const string &name ) {
FGElectricalComponent *FGElectricalSystem::find ( const std::string &name ) {
unsigned int i;
string s;
std::string s;
// search suppliers
for ( i = 0; i < suppliers.size(); ++i ) {

View file

@ -1,29 +1,11 @@
// electrical.hxx - a flexible, generic electrical system model.
//
// Written by Curtis Olson, started September 2002.
//
// Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef _SYSTEMS_ELECTRICAL_HXX
#define _SYSTEMS_ELECTRICAL_HXX 1
/*
* SPDX-FileName: electrical.hxx
* SPDX-FileComment: a flexible, generic electrical system model
* SPDX-FileCopyrightText: Copyright (C) 2002 Curtis L. Olson - http://www.flightgear.org/~curt
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <string>
#include <vector>
@ -49,19 +31,19 @@ public:
};
protected:
using comp_list = std::vector<FGElectricalComponent *> ;
using comp_list = std::vector<FGElectricalComponent*>;
int kind;
std::string name;
float volts;
float load_amps; // sum of current draw (load) due to
// this node and all it's children
float available_amps; // available current (after the load
// is subtracted)
float load_amps; // sum of current draw (load) due to
// this node and all it's children
float available_amps; // available current (after the load
// is subtracted)
comp_list inputs;
comp_list outputs;
simgear::PropertyList props;
public:
@ -73,34 +55,37 @@ public:
inline int get_kind() const { return kind; }
inline float get_volts() const { return volts; }
inline void set_volts( float val ) { volts = val; }
inline void set_volts(float val) { volts = val; }
inline float get_load_amps() const { return load_amps; }
inline void set_load_amps( float val ) { load_amps = val; }
inline void set_load_amps(float val) { load_amps = val; }
inline float get_available_amps() const { return available_amps; }
inline void set_available_amps( float val ) { available_amps = val; }
inline void set_available_amps(float val) { available_amps = val; }
inline int get_num_inputs() const { return outputs.size(); }
inline FGElectricalComponent *get_input( const int i ) {
inline FGElectricalComponent* get_input(const int i)
{
return inputs[i];
}
inline void add_input( FGElectricalComponent *c ) {
inputs.push_back( c );
inline void add_input(FGElectricalComponent* c)
{
inputs.push_back(c);
}
inline int get_num_outputs() const { return outputs.size(); }
inline FGElectricalComponent *get_output( const int i ) {
inline FGElectricalComponent* get_output(const int i)
{
return outputs[i];
}
inline void add_output( FGElectricalComponent *c ) {
outputs.push_back( c );
inline void add_output(FGElectricalComponent* c)
{
outputs.push_back(c);
}
void add_prop( const std::string &s );
void publishVoltageToProps() const;
void add_prop(const std::string& s);
void publishVoltageToProps() const;
};
@ -118,27 +103,27 @@ public:
private:
SGPropertyNode_ptr _rpm_node;
FGSupplierType model; // store supplier type
float ideal_volts; // ideal volts
FGSupplierType model; // store supplier type
float ideal_volts; // ideal volts
// alternator fields
string rpm_src; // property name of alternator power source
float rpm_threshold; // minimal rpm to generate full power
std::string rpm_src; // property name of alternator power source
float rpm_threshold; // minimal rpm to generate full power
// alt & ext supplier fields
float ideal_amps; // total amps produced (above rpm threshold).
float ideal_amps; // total amps produced (above rpm threshold).
// battery fields
float amp_hours; // fully charged battery capacity
float percent_remaining; // percent of charge remaining
float charge_amps; // maximum charge load battery can draw
float amp_hours; // fully charged battery capacity
float percent_remaining; // percent of charge remaining
float charge_amps; // maximum charge load battery can draw
public:
FGElectricalSupplier ( SGPropertyNode *node );
~FGElectricalSupplier () {}
FGElectricalSupplier(SGPropertyNode* node);
~FGElectricalSupplier() {}
inline FGSupplierType get_model() const { return model; }
float apply_load( float amps, float dt );
float apply_load(float amps, float dt);
float get_output_volts();
float get_output_amps();
float get_charge_amps() const { return charge_amps; }
@ -150,8 +135,8 @@ public:
class FGElectricalBus : public FGElectricalComponent
{
public:
FGElectricalBus ( SGPropertyNode *node );
~FGElectricalBus () {}
FGElectricalBus(SGPropertyNode* node);
~FGElectricalBus() {}
};
@ -160,8 +145,8 @@ public:
class FGElectricalOutput : public FGElectricalComponent
{
public:
FGElectricalOutput ( SGPropertyNode *node );
~FGElectricalOutput () {}
FGElectricalOutput(SGPropertyNode* node);
~FGElectricalOutput() {}
};
@ -175,12 +160,12 @@ private:
bool circuit_breaker;
public:
FGElectricalSwitch( SGPropertyNode *node );
FGElectricalSwitch(SGPropertyNode* node);
~FGElectricalSwitch() { };
~FGElectricalSwitch(){};
inline bool get_state() const { return switch_node->getBoolValue(); }
void set_state( bool val ) { switch_node->setBoolValue( val ); }
void set_state(bool val) { switch_node->setBoolValue(val); }
};
@ -190,19 +175,20 @@ class FGElectricalConnector : public FGElectricalComponent
{
comp_list inputs;
comp_list outputs;
typedef vector< FGElectricalSwitch> switch_list;
typedef std::vector<FGElectricalSwitch> switch_list;
switch_list switches;
public:
FGElectricalConnector ( SGPropertyNode *node, FGElectricalSystem *es );
~FGElectricalConnector () {}
FGElectricalConnector(SGPropertyNode* node, FGElectricalSystem* es);
~FGElectricalConnector() {}
void add_switch( FGElectricalSwitch s ) {
switches.push_back( s );
void add_switch(FGElectricalSwitch s)
{
switches.push_back(s);
}
// set all switches to the specified state
void set_switches( bool state );
void set_switches(bool state);
bool get_state();
};
@ -216,8 +202,8 @@ public:
class FGElectricalSystem : public SGSubsystem
{
public:
FGElectricalSystem ( SGPropertyNode *node );
virtual ~FGElectricalSystem ();
FGElectricalSystem(SGPropertyNode* node);
virtual ~FGElectricalSystem();
// Subsystem API.
void bind() override;
@ -229,14 +215,14 @@ public:
// Subsystem identification.
static const char* staticSubsystemClassId() { return "electrical"; }
bool build (SGPropertyNode* config_props);
float propagate( FGElectricalComponent *node, double dt,
float input_volts, float input_amps,
std::string s = "" );
FGElectricalComponent *find ( const std::string &name );
bool build(SGPropertyNode* config_props);
float propagate(FGElectricalComponent* node, double dt,
float input_volts, float input_amps,
std::string s = "");
FGElectricalComponent* find(const std::string& name);
protected:
typedef vector<FGElectricalComponent *> comp_list;
typedef std::vector<FGElectricalComponent*> comp_list;
private:
void deleteComponents(comp_list& comps);
@ -246,7 +232,7 @@ private:
std::string path;
bool enabled;
comp_list suppliers;
comp_list buses;
comp_list outputs;
@ -257,5 +243,3 @@ private:
SGPropertyNode_ptr _serviceable_node;
bool _serviceable = true;
};
#endif // _SYSTEMS_ELECTRICAL_HXX

View file

@ -1,8 +1,10 @@
// pitot.cxx - the pitot air system.
// Written by David Megginson, started 2002.
//
// Last modified by Eric van den Berg, 01 Nov 2013
// This file is in the Public Domain and comes with no warranty.
/*
* SPDX-FileName: pitot.cxx
* SPDX-FileComment: the pitot air system
* SPDX-FileCopyrightText: Written by David Megginson, started 2002.
* SPDX-FileContributor: modified by Eric van den Berg, 01 Nov 2013
* SPDX-License-Identifier: This file is in the Public Domain and comes with no warranty.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
@ -32,7 +34,7 @@ PitotSystem::~PitotSystem ()
void
PitotSystem::init ()
{
string branch;
std::string branch;
branch = "/systems/" + _name;
SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );

View file

@ -1,7 +1,9 @@
// system_mgr.cxx - manage aircraft systems.
// Written by David Megginson, started 2002.
//
// This file is in the Public Domain and comes with no warranty.
/*
* SPDX-FileName: system_mgr.cxx
* SPDX-FileComment: manage aircraft systems
* SPDX-FileCopyrightText: Written by David Megginson, started 2002.
* SPDX-License-Identifier: This file is in the Public Domain and comes with no warranty.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
@ -73,7 +75,7 @@ bool FGSystemMgr::build (SGPropertyNode* config_props)
int count = config_props->nChildren();
for ( i = 0; i < count; ++i ) {
node = config_props->getChild(i);
string name = node->getNameString();
std::string name = node->getNameString();
std::ostringstream temp;
temp << i;
if ( name == "electrical" ) {

View file

@ -1,22 +1,9 @@
// TimeManager.cxx -- simulation-wide time management
//
// Written by James Turner, started July 2010.
//
// Copyright (C) 2010 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*
* SPDX-FileName: TimeManager.cxx
* SPDX-FileComment: simulation-wide time management
* SPDX-FileCopyrightText: Written by James Turner, started July 2010.
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@ -581,13 +568,13 @@ void TimeManager::updateLocalTimeString()
aircraftLocalTime->tm_min, aircraftLocalTime->tm_sec);
// check against current string to avoid changes all the time
string s = _localTimeStringNode->getStringValue();
if (s != string(buf)) {
std::string s = _localTimeStringNode->getStringValue();
if (s != std::string(buf)) {
_localTimeStringNode->setStringValue(buf);
}
string zs = _localTimeZoneNode->getStringValue();
if (zs != string(_impl->get_description())) {
std::string zs = _localTimeZoneNode->getStringValue();
if (zs != std::string(_impl->get_description())) {
_localTimeZoneNode->setStringValue(_impl->get_description());
}
}

View file

@ -1,19 +1,9 @@
// Copyright (C) 2008 Tim Moore
// Copyright (C) 2011 Mathias Froehlich
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*
* SPDX-FileName: CameraGroup.cxx
* SPDX-FileCopyrightText: Copyright (C) 2008 Tim Moore
* SPDX-FileContributor: Copyright (C) 2011 Mathias Froehlich
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "CameraGroup.hxx"
@ -1158,7 +1148,7 @@ void CameraGroup::buildDefaultGroup(osgViewer::View* viewer)
if (oldSyntax) {
for (int i = 0; i < renderingNode->nChildren(); ++i) {
SGPropertyNode* propNode = renderingNode->getChild(i);
const string propName = propNode->getNameString();
const std::string propName = propNode->getNameString();
if (propName == "window" || propName == "camera") {
SGPropertyNode* copiedNode
= cgroupNode->getNode(propName, propNode->getIndex(), true);

View file

@ -1,25 +1,9 @@
// splash.cxx -- draws the initial splash screen
//
// Written by Curtis Olson, started July 1998. (With a little looking
// at Freidemann's panel code.) :-)
//
// Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
/*
* SPDX-FileName: splash.cxx
* SPDX-FileComment: draws the initial splash screen. Written by Curtis Olson, started July 1998.
* SPDX-FileCopyrightText: Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config.h>
@ -858,7 +842,7 @@ void fgSplashProgress( const char *identifier, unsigned int percent )
} else if (kbytesPerSec > 0) {
oss << " - " << kbytesPerSec << " "s << kbytesPerSecUnitText;
} else if (kbytesPendingExtract > 0) {
const string extractText = globals->get_locale()->getLocalizedString("scenery-extract", "sys");
const std::string extractText = globals->get_locale()->getLocalizedString("scenery-extract", "sys");
std::ostringstream os2;
if (kbytesPendingExtract > 1024) {
@ -881,7 +865,7 @@ void fgSplashProgress( const char *identifier, unsigned int percent )
unsigned int kbytesPendingExtract = fgGetInt("/sim/terrasync/extract-pending-kbytes");
if (kbytesPendingExtract > 0) {
const string extractText = globals->get_locale()->getLocalizedString("scenery-extract", "sys");
const std::string extractText = globals->get_locale()->getLocalizedString("scenery-extract", "sys");
std::ostringstream oss;
if (kbytesPendingExtract > 1024) {
int mBytesPendingExtract = kbytesPendingExtract >> 10;
@ -899,8 +883,8 @@ void fgSplashProgress( const char *identifier, unsigned int percent )
// over-write the spinner
if (!strncmp(identifier, "navdata-", 8)) {
const string percentText = globals->get_locale()->getLocalizedString("navdata-load-percent", "sys");
auto finalText = simgear::strutils::replace(percentText, "[VALUE]", to_string(percent));
const std::string percentText = globals->get_locale()->getLocalizedString("navdata-load-percent", "sys");
auto finalText = simgear::strutils::replace(percentText, "[VALUE]", std::to_string(percent));
fgSetString("/sim/startup/splash-progress-spinner", finalText);
}

View file

@ -1,25 +1,10 @@
// viewmgr.cxx -- class for managing all the views in the flightgear world.
//
// Written by Curtis Olson, started October 2000.
// partially rewritten by Jim Wilson March 2002
//
// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
/*
* SPDX-FileName: viewmgr.cxx
* SPDX-FileComment: class for managing all the views in the flightgear world
* SPDX-FileCopyrightText: Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
* SPDX-FileContributor: partially rewritten by Jim Wilson March 2002
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
@ -441,7 +426,7 @@ bool FGViewMgr::video_start(
std::string codec = codec_in;
string directory = fgGetString("/sim/video/directory");
std::string directory = fgGetString("/sim/video/directory");
SGPath path = SGPath(directory);
path.append(name);
if (path.exists())

View file

@ -1,20 +1,9 @@
// fgelev.cxx -- compute scenery elevation
//
// Copyright (C) 2009 - 2012 Mathias Froehlich
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*
* SPDX-FileName: fgelev.cxx
* SPDX-FileComment: compute scenery elevation
* SPDX-FileCopyrightText: Copyright (C) 2009 - 2012 Mathias Froehlich
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -234,7 +223,7 @@ main(int argc, char** argv)
<< "deg lat = " << lat << "deg" << std::endl;
std::cout << id << ": ";
string solid = material && material->get_solid() ? "solid" : "-";
std::string solid = material && material->get_solid() ? "solid" : "-";
if (!found) {
std::cout << "-1000" << std::endl;
} else {