Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements

Fix whitespace changes
This commit is contained in:
Michael Sundqvist
2022-07-10 18:28:56 +03:00
committed by Martin Natano
parent f0680a29fc
commit 0cba3579de
534 changed files with 3456 additions and 3488 deletions
+25 -25
View File
@@ -49,8 +49,8 @@ static const char chXMLTagPre = '/';
static const char chXMLExclamation = '!';
static const char chXMLDash = '-';
static map<RString,RString> g_mapEntitiesToChars;
static map<char,RString> g_mapCharsToEntities;
static std::map<RString, RString> g_mapEntitiesToChars;
static std::map<char, RString> g_mapCharsToEntities;
static void InitEntities()
{
@@ -131,7 +131,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE
// error
if( sErrorOut.empty() )
sErrorOut = ssprintf( "<%s> attribute has error ", pNode->GetName().c_str() );
return string::npos;
return std::string::npos;
}
// XML Attr Name
@@ -175,7 +175,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE
// error
if( sErrorOut.empty() )
sErrorOut = ssprintf( "<%s> attribute text: couldn't find matching quote", sName.c_str() );
return string::npos;
return std::string::npos;
}
RString sValue;
@@ -190,7 +190,7 @@ RString::size_type LoadAttributes( XNode *pNode, const RString &xml, RString &sE
}
// not well-formed tag
return string::npos;
return std::string::npos;
}
// <TAG attr1="value1" attr2='value2' attr3=value3 >
@@ -208,8 +208,8 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
// <
iOffset = xml.find( chXMLTagOpen, iOffset );
if( iOffset == string::npos )
return string::npos;
if( iOffset == std::string::npos )
return std::string::npos;
// </
if( xml[iOffset+1] == chXMLTagPre )
@@ -222,12 +222,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
// Find the close tag.
RString::size_type iEnd = xml.find( "-->", iOffset );
if( iEnd == string::npos )
if( iEnd == std::string::npos )
{
if( sErrorOut.empty() )
sErrorOut = "Unterminated comment";
return string::npos;
return std::string::npos;
}
// Skip -->.
@@ -246,8 +246,8 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
// Generate XML Attribute List
iOffset = LoadAttributes( pNode, xml, sErrorOut, iOffset );
if( iOffset == string::npos )
return string::npos;
if( iOffset == std::string::npos )
return std::string::npos;
// alone tag <TAG ... /> or <?TAG ... ?> or <!-- ... -->
// current pointer: ^ ^ ^
@@ -267,7 +267,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
sErrorOut = "Element must be closed.";
// ill-formed tag
return string::npos;
return std::string::npos;
}
// well-formed tag
@@ -289,12 +289,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
// Text Value
++iOffset;
RString::size_type iEnd = xml.find( chXMLTagOpen, iOffset );
if( iEnd == string::npos )
if( iEnd == std::string::npos )
{
if( sErrorOut.empty() )
sErrorOut = ssprintf( "%s must be closed with </%s>", pNode->GetName().c_str(), pNode->GetName().c_str() );
// error cos not exist CloseTag </TAG>
return string::npos;
return std::string::npos;
}
RString sValue;
@@ -312,7 +312,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
XNode *node = new XNode;
iOffset = LoadInternal( node, xml, sErrorOut, iOffset );
if( iOffset == string::npos )
if( iOffset == std::string::npos )
{
delete node;
return iOffset;
@@ -340,12 +340,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
continue;
RString::size_type iEnd = xml.find_first_of( " >", iOffset );
if( iEnd == string::npos )
if( iEnd == std::string::npos )
{
if( sErrorOut.empty() )
sErrorOut = ssprintf( "it must be closed with </%s>", pNode->GetName().c_str() );
// error
return string::npos;
return std::string::npos;
}
RString closename;
@@ -362,7 +362,7 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
// not welformed open/close
if( sErrorOut.empty() )
sErrorOut = ssprintf( "'<%s> ... </%s>' is not well-formed.", pNode->GetName().c_str(), closename.c_str() );
return string::npos;
return std::string::npos;
}
}
else // Alone child Tag Loaded
@@ -371,12 +371,12 @@ RString::size_type LoadInternal( XNode *pNode, const RString &xml, RString &sErr
{
// Text Value
RString::size_type iEnd = xml.find( chXMLTagOpen, iOffset );
if( iEnd == string::npos )
if( iEnd == std::string::npos )
{
// error cos not exist CloseTag </TAG>
if( sErrorOut.empty() )
sErrorOut = ssprintf( "it must be closed with </%s>", pNode->GetName().c_str() );
return string::npos;
return std::string::npos;
}
RString sValue;
@@ -601,7 +601,7 @@ void XmlFileUtil::AnnotateXNodeTree( XNode *pNode, const RString &sFile )
{
RString sDir = Dirname( sFile );
vector<XNode *> queue;
std::vector<XNode*> queue;
queue.push_back( pNode );
while( !queue.empty() )
{
@@ -623,7 +623,7 @@ void XmlFileUtil::AnnotateXNodeTree( XNode *pNode, const RString &sFile )
void XmlFileUtil::CompileXNodeTree( XNode *pNode, const RString &sFile )
{
vector<XNode *> aToCompile;
std::vector<XNode*> aToCompile;
aToCompile.push_back( pNode );
Lua *L = LUA->Get();
@@ -660,8 +660,8 @@ namespace
}
// Iterate over the table, pulling out attributes and tables to process.
vector<RString> NodeNamesToAdd;
vector<LuaReference> NodesToAdd;
std::vector<RString> NodeNamesToAdd;
std::vector<LuaReference> NodesToAdd;
/* Add array elements first, in array order, so iterating over the XNode
* keeps the array in order. */
@@ -776,7 +776,7 @@ void XmlFileUtil::MergeIniUnder( XNode *pFrom, XNode *pTo )
{
/* Batch up nodes to move, and do them all at once, to deal sanely
* with the possibility of duplicate child names. */
vector<XNodes::iterator> aToMove;
std::vector<XNodes::iterator> aToMove;
// Iterate over each section in pFrom.
XNodes::iterator it = pFrom->GetChildrenBegin();