本文整理汇总了C++中STRING_LIST::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING_LIST::clear方法的具体用法?C++ STRING_LIST::clear怎么用?C++ STRING_LIST::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STRING_LIST
的用法示例。
在下文中一共展示了STRING_LIST::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetConfigurationAndPreserveSpace
bool CProcessConfigReader::GetConfigurationAndPreserveSpace(std::string sAppName, STRING_LIST &Params)
{
Params.clear();
int nBrackets = 0;
Params.clear();
Reset();
std::string sKey = "PROCESSCONFIG="+sAppName;
if(GoTo(sKey))
{
std::string sBracket = GetNextValidLine();
if(sBracket.find("{")==0)
{
nBrackets++;
while(!GetFile()->eof())
{
std::string sLine = GetNextValidLine();
MOOSTrimWhiteSpace(sLine);
if(sLine.find("}")!=0)
{
std::string sVal(sLine);
std::string sTok = MOOSChomp(sVal, "=");
MOOSTrimWhiteSpace(sTok);
MOOSTrimWhiteSpace(sVal);
if (!sTok.empty())
{
if (!sVal.empty())
{
Params.push_back(sTok+"="+sVal);
}
else if(sLine.find("[")!=std::string::npos || sLine.find("]")!=std::string::npos)
{
Params.push_back(sLine);
}
}
}
else
{
return true;
}
//quick error check - we don't allow nested { on single lines
if(sLine.find("{")==0)
{
MOOSTrace("CProcessConfigReader::GetConfiguration() missing \"}\" syntax error in mission file\n");
}
}
}
}
return false;
}
示例2: OnPreIterate
bool CHelmApp::OnPreIterate()
{
TASK_LIST::iterator p;
STRING_LIST NewResources;
STRING_LIST::iterator q;
for(p = m_Tasks.begin();p!=m_Tasks.end();p++)
{
CMOOSBehaviour* pBehaviour = *p;
if(pBehaviour->HasNewRegistration())
{
NewResources.clear();
pBehaviour->GetRegistrations(NewResources);
for(q = NewResources.begin();q!=NewResources.end();q++)
{
if(m_Comms.IsConnected())
{
m_Comms.Register(*q,UPDATE_INTERVAL);
}
}
}
}
return true;
}
示例3: GetClientNames
bool CMOOSCommServer::GetClientNames(STRING_LIST &sList)
{
sList.clear();
SOCKETFD_2_CLIENT_NAME_MAP::iterator p;
for(p = m_Socket2ClientMap.begin();p!=m_Socket2ClientMap.end();p++)
{
sList.push_front(p->second);
}
return true;
}
示例4: GetConfiguration
bool CProcessConfigReader::GetConfiguration(std::string sAppName, STRING_LIST &Params)
{
int nBrackets = 0;
Params.clear();
Reset();
std::string sKey = "PROCESSCONFIG="+sAppName;
if(GoTo(sKey))
{
std::string sBracket = GetNextValidLine();
if(sBracket.find("{")==0)
{
nBrackets++;
while(!GetFile()->eof())
{
std::string sLine = GetNextValidLine();
MOOSRemoveChars(sLine," \t\r");
if(sLine.find("}")!=0)
{
#if(1)
// jckerken 8-12-2004
// ignore if param = <empty string>
std::string sTmp(sLine);
std::string sTok = MOOSChomp(sTmp, "=");
MOOSTrimWhiteSpace(sTok); // Handle potential whitespaces.
MOOSTrimWhiteSpace(sTmp);
if (sTok.size() > 0)
{
MOOSTrimWhiteSpace(sTmp);
if (!sTmp.empty())
{
Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine
}
else if(sLine.find("[")!=std::string::npos || sLine.find("]")!=std::string::npos)
{
Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine
}
}
else
{
Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine
}
#else
Params.push_front(sLine);
#endif
}
else
{
return true;
}
//quick error check - we don't allow nested { on single lines
if(sLine.find("{")==0)
{
MOOSTrace("CProcessConfigReader::GetConfiguration() missing \"}\" syntax error in mission file\n");
}
}
}
}
return false;
}