本文整理汇总了C++中CConfigParser::GetLastDefaultUsed方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfigParser::GetLastDefaultUsed方法的具体用法?C++ CConfigParser::GetLastDefaultUsed怎么用?C++ CConfigParser::GetLastDefaultUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfigParser
的用法示例。
在下文中一共展示了CConfigParser::GetLastDefaultUsed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadStats
/*
** Reads statistics.
**
*/
void CMeasureNet::ReadStats(const std::wstring& iniFile, std::wstring& statsDate)
{
WCHAR buffer[48];
CConfigParser parser;
parser.Initialize(iniFile, NULL, L"Statistics");
const std::wstring& date = parser.ReadString(L"Statistics", L"Since", L"", false);
if (!date.empty())
{
statsDate = date;
}
uint32_t count = parser.ReadUInt(L"Statistics", L"Count", 0);
if (parser.GetLastDefaultUsed())
{
count = parser.ReadUInt(L"Statistics", L"NetStatsCount", 0);
}
c_StatValues.clear();
c_StatValues.reserve(count * 2);
for (uint32_t i = 1; i <= count; ++i)
{
ULARGE_INTEGER value;
_snwprintf_s(buffer, _TRUNCATE, L"In%u", i);
value.QuadPart = parser.ReadUInt64(L"Statistics", buffer, 0);
if (parser.GetLastDefaultUsed())
{
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsInHigh%u", i);
value.HighPart = parser.ReadUInt(L"Statistics", buffer, 0);
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsInLow%u", i);
value.LowPart = parser.ReadUInt(L"Statistics", buffer, 0);
}
c_StatValues.push_back(value.QuadPart);
_snwprintf_s(buffer, _TRUNCATE, L"Out%u", i);
value.QuadPart = parser.ReadUInt64(L"Statistics", buffer, 0);
if (parser.GetLastDefaultUsed())
{
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsOutHigh%u", i);
value.HighPart = parser.ReadUInt(L"Statistics", buffer, 0);
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsOutLow%u", i);
value.LowPart = parser.ReadUInt(L"Statistics", buffer, 0);
}
c_StatValues.push_back(value.QuadPart);
}
}