std::string namespace fixes.

This commit is contained in:
James Turner 2013-06-27 10:13:58 +01:00
parent 82dd1e4be9
commit e5bca74b9d
9 changed files with 25 additions and 26 deletions

View File

@ -40,15 +40,13 @@
#include "iochannel.hxx" #include "iochannel.hxx"
using std::string;
/** /**
* A serial I/O class based on SGIOChannel. * A serial I/O class based on SGIOChannel.
*/ */
class SGSerial : public SGIOChannel { class SGSerial : public SGIOChannel {
string device; std::string device;
string baud; std::string baud;
SGSerialPort port; SGSerialPort port;
char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ]; char save_buf[ 2 * SG_IO_MAX_MSG_SIZE ];
@ -68,7 +66,7 @@ public:
* @param device_name name of serial device * @param device_name name of serial device
* @param baud_rate speed of communication * @param baud_rate speed of communication
*/ */
SGSerial( const string& device_name, const string& baud_rate ); SGSerial( const std::string& device_name, const std::string& baud_rate );
/** Destructor */ /** Destructor */
~SGSerial(); ~SGSerial();

View File

@ -38,9 +38,7 @@
#include <simgear/structure/SGReferenced.hxx> #include <simgear/structure/SGReferenced.hxx>
#include <map> #include <map>
#include <string> #include <string>
using std::string;
class SGPropertyNode; class SGPropertyNode;
@ -69,7 +67,7 @@ public:
* Constructor. Loads the interpolation table from the specified file. * Constructor. Loads the interpolation table from the specified file.
* @param file name of interpolation file * @param file name of interpolation file
*/ */
SGInterpTable( const string& file ); SGInterpTable( const std::string& file );
/** /**

View File

@ -22,6 +22,8 @@
using std::istream; using std::istream;
using std::ostream; using std::ostream;
using std::string;
/** /**
* Condition for a single property. * Condition for a single property.
* *

View File

@ -271,19 +271,19 @@ class ExtensionSupportedExpression
{ {
public: public:
ExtensionSupportedExpression() {} ExtensionSupportedExpression() {}
ExtensionSupportedExpression(const string& extString) ExtensionSupportedExpression(const std::string& extString)
: _extString(extString) : _extString(extString)
{ {
} }
const string& getExtensionString() { return _extString; } const std::string& getExtensionString() { return _extString; }
void setExtensionString(const string& extString) { _extString = extString; } void setExtensionString(const std::string& extString) { _extString = extString; }
void eval(bool&value, const expression::Binding* b) const void eval(bool&value, const expression::Binding* b) const
{ {
int contextId = getOperand(0)->getValue(b); int contextId = getOperand(0)->getValue(b);
value = isGLExtensionSupported((unsigned)contextId, _extString.c_str()); value = isGLExtensionSupported((unsigned)contextId, _extString.c_str());
} }
protected: protected:
string _extString; std::string _extString;
}; };
Expression* extensionSupportedParser(const SGPropertyNode* exp, Expression* extensionSupportedParser(const SGPropertyNode* exp,

View File

@ -36,7 +36,7 @@
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
typedef std::map<string, osg::observer_ptr<simgear::Effect> > EffectMap; typedef std::map<std::string, osg::observer_ptr<simgear::Effect> > EffectMap;
static EffectMap lightEffectMap; static EffectMap lightEffectMap;
#define GET_COLOR_VALUE(n) \ #define GET_COLOR_VALUE(n) \
@ -96,7 +96,7 @@ public:
SGLightAnimation::SGLightAnimation(const SGPropertyNode* configNode, SGLightAnimation::SGLightAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::Options* options, const osgDB::Options* options,
const string &path, int i) : const std::string &path, int i) :
SGAnimation(configNode, modelRoot), SGAnimation(configNode, modelRoot),
_options(options) _options(options)
{ {
@ -113,7 +113,7 @@ SGLightAnimation::SGLightAnimation(const SGPropertyNode* configNode,
_cutoff = getConfig()->getDoubleValue("cutoff"); _cutoff = getConfig()->getDoubleValue("cutoff");
_near = getConfig()->getDoubleValue("near-m"); _near = getConfig()->getDoubleValue("near-m");
_far = getConfig()->getDoubleValue("far-m"); _far = getConfig()->getDoubleValue("far-m");
_key = path + ";" + boost::lexical_cast<string>( i ); _key = path + ";" + boost::lexical_cast<std::string>( i );
SGConstPropertyNode_ptr dim_factor = configNode->getChild("dim-factor"); SGConstPropertyNode_ptr dim_factor = configNode->getChild("dim-factor");
if (dim_factor.valid()) { if (dim_factor.valid()) {

View File

@ -23,7 +23,7 @@ class SGMaterialAnimation : public SGAnimation {
public: public:
SGMaterialAnimation(const SGPropertyNode* configNode, SGMaterialAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::Options* options,const string &path); const osgDB::Options* options,const std::string &path);
virtual osg::Group* createAnimationGroup(osg::Group& parent); virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node); virtual void install(osg::Node& node);
static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp); static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp);

View File

@ -344,7 +344,7 @@ SGAnimation::~SGAnimation()
if (!_found) if (!_found)
{ {
std::list<std::string>::const_iterator i; std::list<std::string>::const_iterator i;
string info; std::string info;
for (i = _objectNames.begin(); i != _objectNames.end(); ++i) for (i = _objectNames.begin(); i != _objectNames.end(); ++i)
{ {
if (!info.empty()) if (!info.empty())
@ -365,7 +365,7 @@ bool
SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode, SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::Options* options, const osgDB::Options* options,
const string &path, int i) const std::string &path, int i)
{ {
std::string type = configNode->getStringValue("type", "none"); std::string type = configNode->getStringValue("type", "none");
if (type == "alpha-test") { if (type == "alpha-test") {

View File

@ -48,7 +48,7 @@ public:
static bool animate(osg::Node* node, const SGPropertyNode* configNode, static bool animate(osg::Node* node, const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::Options* options, const osgDB::Options* options,
const string &path, int i); const std::string &path, int i);
protected: protected:
void apply(osg::Node* node); void apply(osg::Node* node);
@ -354,11 +354,11 @@ public:
SGLightAnimation(const SGPropertyNode* configNode, SGLightAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot, SGPropertyNode* modelRoot,
const osgDB::Options* options, const osgDB::Options* options,
const string &path, int i); const std::string &path, int i);
virtual osg::Group* createAnimationGroup(osg::Group& parent); virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node); virtual void install(osg::Node& node);
private: private:
string _light_type; std::string _light_type;
SGVec3d _position; SGVec3d _position;
SGVec3d _direction; SGVec3d _direction;
SGVec4d _ambient; SGVec4d _ambient;
@ -369,7 +369,7 @@ private:
double _cutoff; double _cutoff;
double _near; double _near;
double _far; double _far;
string _key; std::string _key;
class UpdateCallback; class UpdateCallback;
friend class UpdateCallback; friend class UpdateCallback;
SGSharedPtr<SGExpressiond> _animationValue; SGSharedPtr<SGExpressiond> _animationValue;

View File

@ -26,7 +26,8 @@
#include <vector> #include <vector>
#include <functional> #include <functional>
#include <set> #include <set>
#include <string>
#include <simgear/props/condition.hxx> #include <simgear/props/condition.hxx>
#include <simgear/props/props.hxx> #include <simgear/props/props.hxx>
#include <simgear/math/interpolater.hxx> #include <simgear/math/interpolater.hxx>
@ -949,7 +950,7 @@ namespace simgear
{ {
struct ParseError : public sg_exception struct ParseError : public sg_exception
{ {
ParseError(const string& message = std::string()) ParseError(const std::string& message = std::string())
: sg_exception(message) {} : sg_exception(message) {}
}; };
@ -1014,7 +1015,7 @@ namespace simgear
{ {
public: public:
size_t addBinding(const std::string& name, expression::Type type); size_t addBinding(const std::string& name, expression::Type type);
bool findBinding(const string& name, VariableBinding& result) const; bool findBinding(const std::string& name, VariableBinding& result) const;
std::vector<VariableBinding> bindings; std::vector<VariableBinding> bindings;
}; };
@ -1031,7 +1032,7 @@ namespace simgear
ParserMap& map = getParserMap(); ParserMap& map = getParserMap();
ParserMap::iterator itr = map.find(exp->getName()); ParserMap::iterator itr = map.find(exp->getName());
if (itr == map.end()) if (itr == map.end())
throw ParseError(string("unknown expression ") + exp->getName()); throw ParseError(std::string("unknown expression ") + exp->getName());
exp_parser parser = itr->second; exp_parser parser = itr->second;
return (*parser)(exp, this); return (*parser)(exp, this);
} }