From: James Turner Date: Tue, 20 Nov 2012 17:10:13 +0000 (+0000) Subject: Modernise the mat lib header, remove 'using std' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=80dc28bfb5d5ad81ea9006b3170c29dd1dc34d55;p=simgear.git Modernise the mat lib header, remove 'using std' --- diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index 82214725..279a6cfe 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -77,7 +77,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath, if (!strcmp(node->getName(), "material")) { SGSharedPtr m = new SGMaterial(options.get(), node, prop_root); - vectornames = node->getChildren("name"); + std::vectornames = node->getChildren("name"); for ( unsigned int j = 0; j < names.size(); j++ ) { string name = names[j]->getStringValue(); // cerr << "Material " << name << endl; diff --git a/simgear/scene/material/matlib.hxx b/simgear/scene/material/matlib.hxx index 7d52e5c1..8033ea3c 100644 --- a/simgear/scene/material/matlib.hxx +++ b/simgear/scene/material/matlib.hxx @@ -25,10 +25,6 @@ #define _MATLIB_HXX -#ifndef __cplusplus -# error This library requires C++ -#endif - #include #include @@ -37,20 +33,11 @@ #include // STL associative "array" #include // STL "array" -#include - class SGMaterial; class SGPropertyNode; -using std::string; -using std::map; -using std::vector; -using std::less; - -namespace simgear -{ -class Effect; -} +namespace simgear { class Effect; } +namespace osg { class Geode; } // Material management class class SGMaterialLib { @@ -60,7 +47,7 @@ private: // associative array of materials typedef std::vector< SGSharedPtr > material_list; typedef material_list::iterator material_list_iterator; - typedef map < string, material_list> material_map; + typedef std::map < std::string, material_list> material_map; typedef material_map::iterator material_map_iterator; typedef material_map::const_iterator const_material_map_iterator; @@ -72,10 +59,10 @@ public: SGMaterialLib ( void ); // Load a library of material properties - bool load( const string &fg_root, const string& mpath, + bool load( const std::string &fg_root, const std::string& mpath, SGPropertyNode *prop_root ); // find a material record by material name - SGMaterial *find( const string& material ); + SGMaterial *find( const std::string& material ); material_map_iterator begin() { return matlib.begin(); } const_material_map_iterator begin() const { return matlib.begin(); } diff --git a/simgear/scene/tgdb/apt_signs.cxx b/simgear/scene/tgdb/apt_signs.cxx index a04c1a3b..ab60c232 100644 --- a/simgear/scene/tgdb/apt_signs.cxx +++ b/simgear/scene/tgdb/apt_signs.cxx @@ -46,6 +46,7 @@ #define SIGN "OBJECT_SIGN: " using std::vector; +using std::string; using namespace simgear; // for temporary storage of sign elements