本文整理汇总了C++中CDataReader::getActiveLine方法的典型用法代码示例。如果您正苦于以下问题:C++ CDataReader::getActiveLine方法的具体用法?C++ CDataReader::getActiveLine怎么用?C++ CDataReader::getActiveLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDataReader
的用法示例。
在下文中一共展示了CDataReader::getActiveLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void CLocalizationFormat::unserializeLine(void)
{
CDataReader *pDataReader = CDataReader::getInstance();
string strLine = *pDataReader->getActiveLine();
strLine = CStringUtility::trim(strLine, " ");
strLine = CStringUtility::trim(strLine, "\t");
if (strLine == "")
{
// blank line
return;
}
else if (strLine.c_str()[0] == '#')
{
// comment line
return;
}
else
{
// remove comment from end of line
string strComment = "";
size_t uiCommentPosition = strLine.find('#');
if (uiCommentPosition != string::npos)
{
strComment = strLine.substr(uiCommentPosition + 1);
strLine = strLine.substr(0, uiCommentPosition);
}
uint32 uiFirstCommaPosition = strLine.find(',');
if (uiFirstCommaPosition == string::npos)
{
// line does not have comma
return;
}
string strInternalName = strLine.substr(0, uiFirstCommaPosition);
string strLanguageText = strLine.substr(uiFirstCommaPosition + 1);
strInternalName = CStringUtility::trim(strInternalName, " ");
strInternalName = CStringUtility::trim(strInternalName, "\t");
strLanguageText = CStringUtility::trim(strLanguageText, " ");
strLanguageText = CStringUtility::trim(strLanguageText, "\t");
if (strLanguageText == "")
{
// line does not have language text set
return;
}
m_umapTranslatedText[strInternalName] = strLanguageText;
}
}
示例2: if
void CDATLoaderFormat::unserializeLine(void)
{
CDataReader *pDataReader = CDataReader::getInstance();
string strLine = *pDataReader->getActiveLine();
// remove comment from end of line
string strComment = "";
size_t uiCommentPosition = strLine.find('#');
if (uiCommentPosition != string::npos)
{
strComment = strLine.substr(uiCommentPosition);
strLine = strLine.substr(0, uiCommentPosition);
}
if (strLine == "")
{
// blank line
}
else if (CStringUtility::ltrim(strLine).c_str()[0] == '#')
{
// line is a comment
}
else
{
// parse line
deque<string> deqTokens = CVectorUtility::convertVectorToDeque(CStringUtility::split(strLine, " "));
CDATLoaderEntry *pDATLoaderEntry = new CDATLoaderEntry;
pDATLoaderEntry->setEntryType(CDATLoaderManager::getDATEntryTypeFromString(deqTokens[0]));
deqTokens.pop_front();
pDATLoaderEntry->setEntryValues(deqTokens);
addEntry(pDATLoaderEntry);
}
}