1
0
Fork 0

more ( string == "" ) to ( string.empty() ) conversions.

This commit is contained in:
curt 2002-03-21 05:31:55 +00:00
parent e45cb5d0aa
commit c032f841e2

View file

@ -290,7 +290,7 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
string propName = node->getStringValue("property", ""); string propName = node->getStringValue("property", "");
SGPropertyNode * target = 0; SGPropertyNode * target = 0;
if (type == "") { if (type.empty()) {
SG_LOG( SG_COCKPIT, SG_ALERT, SG_LOG( SG_COCKPIT, SG_ALERT,
"No type supplied for transformation " << name "No type supplied for transformation " << name
<< " assuming \"rotation\"" ); << " assuming \"rotation\"" );
@ -392,7 +392,7 @@ readTextChunk (const SGPropertyNode * node)
string format = node->getStringValue("format"); string format = node->getStringValue("format");
// Default to literal text. // Default to literal text.
if (type == "") { if (type.empty()) {
SG_LOG( SG_COCKPIT, SG_INFO, "No type provided for text chunk " << name SG_LOG( SG_COCKPIT, SG_INFO, "No type provided for text chunk " << name
<< " assuming \"literal\""); << " assuming \"literal\"");
type = "literal"; type = "literal";
@ -467,7 +467,7 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
h = int(h * h_scale); h = int(h * h_scale);
if (type == "") { if (type.empty()) {
SG_LOG( SG_COCKPIT, SG_ALERT, SG_LOG( SG_COCKPIT, SG_ALERT,
"No type supplied for layer " << name "No type supplied for layer " << name
<< " assuming \"texture\"" ); << " assuming \"texture\"" );
@ -550,7 +550,7 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
layer = new FGMagRibbon(w, h); layer = new FGMagRibbon(w, h);
} }
else if (layerclass == "") { else if (layerclass.empty()) {
SG_LOG( SG_COCKPIT, SG_ALERT, "No class provided for built-in layer " SG_LOG( SG_COCKPIT, SG_ALERT, "No class provided for built-in layer "
<< name ); << name );
return 0; return 0;
@ -717,7 +717,7 @@ readPanel (const SGPropertyNode * root)
// Assign the background texture, if any, or a bogus chequerboard. // Assign the background texture, if any, or a bogus chequerboard.
// //
string bgTexture = root->getStringValue("background"); string bgTexture = root->getStringValue("background");
if (bgTexture == "") if (bgTexture.empty())
bgTexture = "FOO"; bgTexture = "FOO";
panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str())); panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str()));
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << bgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << bgTexture );
@ -731,43 +731,43 @@ readPanel (const SGPropertyNode * root)
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[1]"); mbgTexture = root->getStringValue("multibackground[1]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 1); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 1);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[2]"); mbgTexture = root->getStringValue("multibackground[2]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 2); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 2);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[3]"); mbgTexture = root->getStringValue("multibackground[3]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 3); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 3);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[4]"); mbgTexture = root->getStringValue("multibackground[4]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 4); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 4);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[5]"); mbgTexture = root->getStringValue("multibackground[5]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 5); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 5);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[6]"); mbgTexture = root->getStringValue("multibackground[6]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 6); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 6);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );
mbgTexture = root->getStringValue("multibackground[7]"); mbgTexture = root->getStringValue("multibackground[7]");
if (mbgTexture == "") if (mbgTexture.empty())
mbgTexture = "FOO"; mbgTexture = "FOO";
panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 7); panel->setMultiBackground(FGTextureManager::createTexture(mbgTexture.c_str()), 7);
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture ); SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << mbgTexture );