本文整理汇总了C++中CConfigParser::GetMeasure方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfigParser::GetMeasure方法的具体用法?C++ CConfigParser::GetMeasure怎么用?C++ CConfigParser::GetMeasure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfigParser
的用法示例。
在下文中一共展示了CConfigParser::GetMeasure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindSecondaryMeasures
/*
** Reads and binds secondary measures (MeasureName2 - MeasureNameN).
**
*/
void CMeter::BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section)
{
if (!m_Measures.empty())
{
WCHAR tmpName[64];
int i = 2;
do
{
_snwprintf_s(tmpName, _TRUNCATE, L"MeasureName%i", i);
const std::wstring& measureName = parser.ReadString(section, tmpName, L"");
CMeasure* measure = parser.GetMeasure(measureName);
if (measure)
{
m_Measures.push_back(measure);
}
else
{
if (!measureName.empty())
{
LogWithArgs(LOG_ERROR, L"MeasureName%i=%s is not valid in [%s]", i, measureName.c_str(), section);
}
break;
}
++i;
}
while (true);
}
}
示例2: BindMeasures
/*
** Overwritten method to handle the secondary measure binding.
**
*/
void CMeterHistogram::BindMeasures(CConfigParser& parser, const WCHAR* section)
{
if (BindPrimaryMeasure(parser, section, false))
{
const std::wstring* secondaryMeasure = &parser.ReadString(section, L"MeasureName2", L"");
if (secondaryMeasure->empty())
{
// For backwards compatibility.
secondaryMeasure = &parser.ReadString(section, L"SecondaryMeasureName", L"");
}
CMeasure* measure = parser.GetMeasure(*secondaryMeasure);
if (measure)
{
m_Measures.push_back(measure);
}
}
}
示例3: BindPrimaryMeasure
/*
** Reads and binds the primary MeasureName. This must always be called in overridden
** BindMeasures() implementations.
**
*/
bool CMeter::BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, bool optional)
{
m_Measures.clear();
const std::wstring& measureName = parser.ReadString(section, L"MeasureName", L"");
CMeasure* measure = parser.GetMeasure(measureName);
if (measure)
{
m_Measures.push_back(measure);
return true;
}
else if (!optional)
{
LogWithArgs(LOG_ERROR, L"MeasureName=%s is not valid in [%s]", measureName.c_str(), section);
}
return false;
}