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


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

本文整理汇总了C++中CConfigParser::ReadFormula方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfigParser::ReadFormula方法的具体用法?C++ CConfigParser::ReadFormula怎么用?C++ CConfigParser::ReadFormula使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CConfigParser的用法示例。


在下文中一共展示了CConfigParser::ReadFormula方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadConfig

/*
** Read the meter-specific configs from the ini-file.
**
*/
void CMeterRoundLine::ReadConfig(CConfigParser& parser, const WCHAR* section)
{
	// Read common configs
	CMeter::ReadConfig(parser, section);

	m_LineWidth = parser.ReadFormula(section, L"LineWidth", 1.0);
	m_LineLength = parser.ReadFormula(section, L"LineLength", 20.0);
	m_LineStart = parser.ReadFormula(section, L"LineStart", -1.0);
	m_StartAngle = parser.ReadFormula(section, L"StartAngle", 0.0);
	m_RotationAngle = parser.ReadFormula(section, L"RotationAngle", 6.2832);
	m_ValueRemainder = parser.ReadInt(section, L"ValueReminder", 0);		// Typo
	m_ValueRemainder = parser.ReadInt(section, L"ValueRemainder", m_ValueRemainder);
	m_LineColor = parser.ReadColor(section, L"LineColor", Color::Black);
	m_Solid = 0!=parser.ReadInt(section, L"Solid", 0);
	m_CntrlAngle = 0!=parser.ReadInt(section, L"ControlAngle", 1);
	m_CntrlLineStart = 0!=parser.ReadInt(section, L"ControlStart", 0);
	m_CntrlLineLength = 0!=parser.ReadInt(section, L"ControlLength", 0);
	m_LineStartShift = parser.ReadFloat(section, L"StartShift", 0.0);
	m_LineLengthShift = parser.ReadFloat(section, L"LengthShift", 0.0);
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:24,代码来源:MeterRoundLine.cpp

示例2: ReadConfig

/*
** Reads the common configs for all Measures. The inherited classes
** must call the base implementation if they overwrite this method.
**
*/
void CMeasure::ReadConfig(CConfigParser& parser, const WCHAR* section)
{
	// Clear substitutes to prevent from being added more than once.
	if (!m_Substitute.empty())
	{
		m_Substitute.clear();
	}

	m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0);

	if (!m_Initialized)
	{
		m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0);
	}
	else
	{
		const std::wstring& result = parser.ReadString(section, L"Disabled", L"0");
		if (parser.GetLastReplaced())
		{
			m_Disabled = 0!=parser.ParseInt(result.c_str(), 0);
		}
	}

	int updateDivider = parser.ReadInt(section, L"UpdateDivider", 1);
	if (updateDivider != m_UpdateDivider)
	{
		m_UpdateCounter = m_UpdateDivider = updateDivider;
	}

	m_MinValue = parser.ReadFormula(section, L"MinValue", m_MinValue);
	m_MaxValue = parser.ReadFormula(section, L"MaxValue", m_MaxValue);

	// The ifabove/ifbelow define actions that are ran when the value goes above/below the given number.

	m_IfAboveValue = parser.ReadFormula(section, L"IfAboveValue", 0.0);
	m_IfAboveAction = parser.ReadString(section, L"IfAboveAction", L"", false);

	m_IfBelowValue = parser.ReadFormula(section, L"IfBelowValue", 0.0);
	m_IfBelowAction = parser.ReadString(section, L"IfBelowAction", L"", false);

	m_IfEqualValue = parser.ReadFormula(section, L"IfEqualValue", 0.0);
	m_IfEqualAction = parser.ReadString(section, L"IfEqualAction", L"", false);

	m_AverageSize = parser.ReadUInt(section, L"AverageSize", 0);

	m_DynamicVariables = 0!=parser.ReadInt(section, L"DynamicVariables", 0);

	m_RegExpSubstitute = 0!=parser.ReadInt(section, L"RegExpSubstitute", 0);
	std::wstring subs = parser.ReadString(section, L"Substitute", L"");
	if (!subs.empty())
	{
		if ((subs[0] != L'"' || subs[subs.length() - 1] != L'\'') &&
			(subs[0] != L'\'' || subs[subs.length() - 1] != L'"'))
		{
			// Add quotes since they are removed by the GetProfileString
			subs.insert(0, 1, L'"');
			subs += L'"';
		}
		if (!ParseSubstitute(subs))
		{
			LogWithArgs(LOG_ERROR, L"Measure: Invalid Substitute=%s", subs.c_str());
		}
	}

	const std::wstring& group = parser.ReadString(section, L"Group", L"");
	InitializeGroup(group);
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:72,代码来源:Measure.cpp


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