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


C++ emu_file::printf方法代码示例

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


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

示例1:

void cheat_script::script_entry::output_argument::save(emu_file &cheatfile) const
{
	cheatfile.printf("\t\t\t\t<argument");
	if (m_count != 1)
		cheatfile.printf(" count=\"%d\"", (int)m_count);
	cheatfile.printf(">%s</argument>\n", cheat_manager::quote_expression(m_expression).c_str());
}
开发者ID:crazii,项目名称:mameui,代码行数:7,代码来源:cheat.cpp

示例2: save

void cheat_parameter::save(emu_file &cheatfile) const
{
	// output the parameter tag
	cheatfile.printf("\t\t<parameter");

	// if no items, just output min/max/step
	if (!has_itemlist())
	{
		if (m_minval != 0)
			cheatfile.printf(" min=\"%s\"", m_minval.format().c_str());
		if (m_maxval != 0)
			cheatfile.printf(" max=\"%s\"", m_maxval.format().c_str());
		if (m_stepval != 1)
			cheatfile.printf(" step=\"%s\"", m_stepval.format().c_str());
		cheatfile.printf("/>\n");
	}

	// iterate over items
	else
	{
		cheatfile.printf(">\n");
		for (auto &curitem : m_itemlist)
			cheatfile.printf("\t\t\t<item value=\"%s\">%s</item>\n", curitem->value().format().c_str(), curitem->text());
		cheatfile.printf("\t\t</parameter>\n");
	}
}
开发者ID:crazii,项目名称:mameui,代码行数:26,代码来源:cheat.cpp

示例3: save

void cheat_parameter::save(emu_file &cheatfile) const
{
	// output the parameter tag
	cheatfile.printf("\t\t<parameter");

	// if no items, just output min/max/step
	astring string;
	if (!has_itemlist())
	{
		if (m_minval != 0)
			cheatfile.printf(" min=\"%s\"", m_minval.format(string));
		if (m_maxval != 0)
			cheatfile.printf(" max=\"%s\"", m_maxval.format(string));
		if (m_stepval != 1)
			cheatfile.printf(" step=\"%s\"", m_stepval.format(string));
		cheatfile.printf("/>\n");
	}

	// iterate over items
	else
	{
		for (const item *curitem = m_itemlist.first(); curitem != NULL; curitem = curitem->next())
			cheatfile.printf("\t\t\t<item value=\"%s\">%s</item>\n", curitem->value().format(string), curitem->text());
		cheatfile.printf("\t\t</parameter>\n");
	}
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:26,代码来源:cheat.c

示例4: if

void cheat_script::script_entry::save(emu_file &cheatfile) const
{
	astring tempstring;

	// output an action
	if (!m_format)
	{
		cheatfile.printf("\t\t\t<action");
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
		cheatfile.printf(">%s</action>\n", cheat_manager::quote_expression(tempstring, m_expression));
	}

	// output an output
	else
	{
		cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.cstr());
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
		if (m_line != 0)
			cheatfile.printf(" line=\"%d\"", m_line);
		if (m_justify == JUSTIFY_CENTER)
			cheatfile.printf(" align=\"center\"");
		else if (m_justify == JUSTIFY_RIGHT)
			cheatfile.printf(" align=\"right\"");
		if (m_arglist.count() == 0)
			cheatfile.printf(" />\n");

		// output arguments
		else
		{
			cheatfile.printf(">\n");
			for (const output_argument *curarg = m_arglist.first(); curarg != NULL; curarg = curarg->next())
				curarg->save(cheatfile);
			cheatfile.printf("\t\t\t</output>\n");
		}
	}
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:38,代码来源:cheat.c

示例5: if

void cheat_script::script_entry::save(emu_file &cheatfile) const
{
	// output an action
	if (m_format.empty())
	{
		cheatfile.printf("\t\t\t<action");
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
		cheatfile.printf(">%s</action>\n", cheat_manager::quote_expression(m_expression).c_str());
	}

	// output an output
	else
	{
		cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.c_str());
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
		if (m_line != 0)
			cheatfile.printf(" line=\"%d\"", m_line);
		if (m_justify == ui::text_layout::CENTER)
			cheatfile.printf(" align=\"center\"");
		else if (m_justify == ui::text_layout::RIGHT)
			cheatfile.printf(" align=\"right\"");
		if (m_arglist.size() == 0)
			cheatfile.printf(" />\n");

		// output arguments
		else
		{
			cheatfile.printf(">\n");
			for (auto &curarg : m_arglist)
				curarg->save(cheatfile);
			cheatfile.printf("\t\t\t</output>\n");
		}
	}
}
开发者ID:crazii,项目名称:mameui,代码行数:36,代码来源:cheat.cpp


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