当前位置: 首页>>代码示例>>C++>>正文


C++ CConfigParser::GetMeasure方法代码示例

本文整理汇总了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);
	}
}
开发者ID:AlfiyaZi,项目名称:rainmeter,代码行数:34,代码来源:Meter.cpp

示例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);
		}
	}
}
开发者ID:dpvreony-forks,项目名称:rainmeter,代码行数:22,代码来源:MeterHistogram.cpp

示例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;
}
开发者ID:AlfiyaZi,项目名称:rainmeter,代码行数:24,代码来源:Meter.cpp


注:本文中的CConfigParser::GetMeasure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。