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


C++ string_base::add_byte方法代码示例

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


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

示例1: urlEncodeAppendRaw

void urlEncodeAppendRaw(pfc::string_base & out, const char * in, t_size inSize) {
	for(t_size walk = 0; walk < inSize; ++walk) {
		const char c = in[walk];
		if (c == ' ') out.add_byte('+');
		else if (pfc::char_is_ascii_alphanumeric(c) || c == '_') out.add_byte(c);
		else out << "%" << pfc::format_hex((t_uint8)c, 2);
	}
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:8,代码来源:string_base.cpp

示例2: urlEncodeAppend

void urlEncodeAppend(pfc::string_base & out, const char * in) {
	for(;;) {
		const char c = *(in++);
		if (c == 0) break;
		else if (c == ' ') out.add_byte('+');
		else if (pfc::char_is_ascii_alphanumeric(c) || c == '_') out.add_byte(c);
		else out << "%" << pfc::format_hex((t_uint8)c, 2);
	}
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:9,代码来源:string_base.cpp

示例3: double_to_string

void double_to_string(double blah, pfc::string_base & p_out, int points = 10, bool ms = true)
{
	int decimal, sign;
	pfc::array_t<char> buffer;
	buffer.set_size(_CVTBUFSIZE);
	buffer.fill_null();
	_fcvt_s(buffer.get_ptr(), buffer.get_size(), blah*(ms ? 1000.0 : 1.0), points, &decimal, &sign);
	const char * ptr = buffer.get_ptr();
	if (decimal <= 0)
	{
		p_out.add_string("0.",2);
		while (decimal) 
		{
			p_out.add_byte('0');
			decimal ++;
		}
		p_out.add_string(ptr, pfc_infinite);
	}
	else
	{
		p_out.add_string(ptr, decimal);
		p_out.add_string(".",1);
		ptr += decimal;
		p_out.add_string(ptr,pfc_infinite);
	}
}
开发者ID:i7voodoo,项目名称:columns_ui,代码行数:26,代码来源:config_columns.cpp

示例4: get_mask

	virtual bool get_mask(unsigned idx, pfc::string_base & out)
	{
		if (idx > 0) return false;
		out.reset();
		for (int n = 0; n < 14; n++)
		{
			if (n) out.add_byte(';');
			out << "*." << extensions[n];
		}
		return true;
	}
开发者ID:FauxFaux,项目名称:foo_mudlord,代码行数:11,代码来源:input_modplug.cpp

示例5: remove_color_marks

void titleformat_compiler::remove_color_marks(const char * src,pfc::string_base & out)//helper
{
	out.reset();
	while(*src)
	{
		if (*src==3)
		{
			src++;
			while(*src && *src!=3) src++;
			if (*src==3) src++;
		}
		else out.add_byte(*src++);
	}
}
开发者ID:reupen,项目名称:foobar2000-sdk,代码行数:14,代码来源:titleformat.cpp

示例6: mainpath_from_guid

	void mainpath_from_guid(const GUID & p_guid, const GUID & p_subguid, pfc::string_base & p_out, bool b_short)
	{
		p_out.reset();
		service_enum_t<mainmenu_commands> e;
		service_ptr_t<mainmenu_commands> ptr;

		unsigned p_service_item_index;
		while (e.next(ptr))
		{
			service_ptr_t<mainmenu_commands_v2> ptr_v2;
			ptr->service_query_t(ptr_v2);
			unsigned p_service_item_count = ptr->get_command_count();
			for (p_service_item_index = 0; p_service_item_index < p_service_item_count; p_service_item_index++)
			{
				if (p_guid == ptr->get_command(p_service_item_index))
				{
					pfc::string8 name;
					ptr->get_name(p_service_item_index, name);
					if (p_subguid != pfc::guid_null && ptr_v2.is_valid() && ptr_v2->is_command_dynamic(p_service_item_index))
					{
						pfc::string8 name_sub;
						mainmenu_node::ptr ptr_node = ptr_v2->dynamic_instantiate(p_service_item_index);
						mainmenunode_subguid_to_path(ptr_node, p_subguid, name_sub, true);
						name << "/" << name_sub;
					}
					if (!b_short)
					{
						pfc::list_t<pfc::string8> levels;
						GUID parent = ptr->get_parent();
						while (parent != pfc::guid_null)
						{
							pfc::string8 parentname;
							if (maingroupname_from_guid(GUID(parent), parentname, parent))
								levels.insert_item(parentname, 0);
						}
						unsigned i, count = levels.get_count();
						for (i = 0; i<count; i++)
						{
							p_out.add_string(levels[i]);
							p_out.add_byte('/');

						}
					}
					p_out.add_string(name);
				}

			}
		}
	}
开发者ID:9060,项目名称:columns_ui,代码行数:49,代码来源:menu_helpers.cpp

示例7: fix_ampersand

static void fix_ampersand(const char * src,pfc::string_base & out)
{
	unsigned ptr = 0;
	while(src[ptr])
	{
		if (src[ptr]=='&')
		{
			out.add_string("&&");
			ptr++;
			while(src[ptr]=='&')
			{
				out.add_string("&&");
				ptr++;
			}
		}
		else out.add_byte(src[ptr++]);
	}
}
开发者ID:AICIDNN,项目名称:lastfm-desktop,代码行数:18,代码来源:menu_manager.cpp

示例8:

void ui_extension::menu_hook_impl::fix_ampersand(const char * src,pfc::string_base & out)
{
	unsigned ptr = 0;
	while(src[ptr])
	{
		if (src[ptr]=='&')
		{
			out.add_string("&&");
			ptr++;
			while(src[ptr]=='&')
			{
				out.add_string("&&");
				ptr++;
			}
		}
		else out.add_byte(src[ptr++]);
	}
}
开发者ID:andinue,项目名称:foo_alsong_lyric,代码行数:18,代码来源:ui_extension.cpp

示例9: __contextpath_from_guid_recur

	bool __contextpath_from_guid_recur(contextmenu_item_node * p_node, const GUID & p_subcommand, pfc::string_base & p_out, bool b_short, bool b_root)
	{
		if (p_node)
		{
			if (p_node->get_type() == contextmenu_item_node::TYPE_POPUP)
			{
				pfc::string8 subname, temp = p_out;
				unsigned dummy;
				p_node->get_display_data(subname, dummy, metadb_handle_list(), contextmenu_item::caller_keyboard_shortcut_list);
				if (temp.get_length() && temp.get_ptr()[temp.get_length() - 1] != '/')
					temp.add_byte('/');
				temp << subname;
				unsigned child, child_count = p_node->get_children_count();
				for (child = 0; child<child_count; child++)
				{
					contextmenu_item_node * p_child = p_node->get_child(child);
					if (__contextpath_from_guid_recur(p_child, p_subcommand, temp, b_short, false))
					{
						p_out = temp;
						return true;
					}
				}
			}
			else if (p_node->get_type() == contextmenu_item_node::TYPE_COMMAND && !b_root)
			{
				if (p_node->get_guid() == p_subcommand)
				{
					pfc::string8 subname;
					unsigned dummy;
					p_node->get_display_data(subname, dummy, metadb_handle_list(), contextmenu_item::caller_keyboard_shortcut_list);
					if (!b_short)
						p_out.add_byte('/');
					else
						p_out.reset();
					p_out.add_string(subname);
					return true;
				}
			}
		}
		return false;
	}
开发者ID:9060,项目名称:columns_ui,代码行数:41,代码来源:menu_helpers.cpp

示例10: contextpath_from_guid

	void contextpath_from_guid(const GUID & p_guid, const GUID & p_subcommand, pfc::string_base & p_out, bool b_short)
	{
		p_out.reset();
		service_enum_t<contextmenu_item> e;
		service_ptr_t<contextmenu_item> ptr;

		unsigned p_service_item_index;
		while (e.next(ptr))
		{
			unsigned p_service_item_count = ptr->get_num_items();
			for (p_service_item_index = 0; p_service_item_index < p_service_item_count; p_service_item_index++)
			{
				if (p_guid == ptr->get_item_guid(p_service_item_index))
				{
					pfc::string8 name;
					ptr->get_item_name(p_service_item_index, name);
					if (!b_short)
					{
						ptr->get_item_default_path(p_service_item_index, p_out);
						if (p_out.get_length() && p_out[p_out.get_length() - 1] != '/')
							p_out.add_byte('/');
					}
					p_out.add_string(name);

					if (p_subcommand != pfc::guid_null)
					{
						pfc::ptrholder_t<contextmenu_item_node_root> p_node(ptr->instantiate_item(p_service_item_index, metadb_handle_list(), contextmenu_item::caller_keyboard_shortcut_list));

						if (p_node.is_valid())
							if (__contextpath_from_guid_recur(p_node.get_ptr(), p_subcommand, p_out, b_short, true))
								return;
					}
				}

			}
		}
	}
开发者ID:9060,项目名称:columns_ui,代码行数:37,代码来源:menu_helpers.cpp


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