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


C++ convert_from_native函数代码示例

本文整理汇总了C++中convert_from_native函数的典型用法代码示例。如果您正苦于以下问题:C++ convert_from_native函数的具体用法?C++ convert_from_native怎么用?C++ convert_from_native使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: convert_from_wstring

	std::string directory::file() const
	{
#ifdef TORRENT_WINDOWS
#if TORRENT_USE_WSTRING
		return convert_from_wstring(m_fd.cFileName);
#else
		return convert_from_native(m_fd.cFileName);
#endif
#else
		return convert_from_native(m_dirent.d_name);
#endif
	}
开发者ID:bird1015,项目名称:avplayer,代码行数:12,代码来源:file.cpp

示例2: snprintf

	std::string i2p_alert::message() const
	{
		char msg[600];
		snprintf(msg, sizeof(msg), "i2p_error: [%s] %s"
			, error.category().name(), convert_from_native(error.message()).c_str());
		return msg;
	}
开发者ID:kevindhawkins,项目名称:libtorrent,代码行数:7,代码来源:alert.cpp

示例3: snprintf

	std::string peer_disconnected_alert::message() const
	{
		char msg[600];
		snprintf(msg, sizeof(msg), "%s disconnecting: [%s] %s", peer_alert::message().c_str()
			, error.category().name(), convert_from_native(error.message()).c_str());
		return msg;
	}
开发者ID:EricMyers47,项目名称:OpenSpace,代码行数:7,代码来源:alert.cpp

示例4: mapping

	portmap_error_alert::portmap_error_alert(int i, int t, error_code const& e)
		:  mapping(i), map_type(t), error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
开发者ID:EricMyers47,项目名称:OpenSpace,代码行数:7,代码来源:alert.cpp

示例5: snprintf

	std::string mmap_cache_alert::message() const
	{
		char msg[600];
		snprintf(msg, sizeof(msg), "mmap cache failed: (%d) %s", error.value()
			, convert_from_native(error.message()).c_str());
		return msg;
	}
开发者ID:microIBM,项目名称:libtorrent,代码行数:7,代码来源:alert.cpp

示例6: tracker_alert

	scrape_failed_alert::scrape_failed_alert(torrent_handle const& h
		, std::string const& u
		, error_code const& e)
		: tracker_alert(h, u)
		, msg(convert_from_native(e.message()))
	{
		TORRENT_ASSERT(!url.empty());
	}
开发者ID:EricMyers47,项目名称:OpenSpace,代码行数:8,代码来源:alert.cpp

示例7: torrent_alert

	url_seed_alert::url_seed_alert(
		torrent_handle const& h
		, std::string const& u
		, error_code const& e)
		: torrent_alert(h)
		, url(u)
		, msg(convert_from_native(e.message()))
	{}
开发者ID:EricMyers47,项目名称:OpenSpace,代码行数:8,代码来源:alert.cpp

示例8: peer_alert

	peer_error_alert::peer_error_alert(torrent_handle const& h, tcp::endpoint const& ep
		, peer_id const& peer_id, error_code const& e)
		: peer_alert(h, ep, peer_id)
		, error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
开发者ID:EricMyers47,项目名称:OpenSpace,代码行数:9,代码来源:alert.cpp

示例9: torrent_alert

	save_resume_data_failed_alert::save_resume_data_failed_alert(aux::stack_allocator& alloc
		, torrent_handle const& h, error_code const& e)
		: torrent_alert(alloc, h)
		, error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
开发者ID:kevindhawkins,项目名称:libtorrent,代码行数:9,代码来源:alert.cpp

示例10: throw

	const char* libtorrent_exception::what() const throw()
	{
		if (!m_msg)
		{
			std::string msg = convert_from_native(m_error.message());
			m_msg = allocate_string_copy(msg.c_str());
		}

		return m_msg;
	}
开发者ID:AdamWill,项目名称:twister-core,代码行数:10,代码来源:error_code.cpp

示例11: peer_alert

	peer_error_alert::peer_error_alert(aux::stack_allocator& alloc, torrent_handle const& h
		, tcp::endpoint const& ep, peer_id const& peer_id, int op
		, error_code const& e)
		: peer_alert(alloc, h, ep, peer_id)
		, operation(op)
		, error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
开发者ID:kevindhawkins,项目名称:libtorrent,代码行数:11,代码来源:alert.cpp

示例12: tracker_alert

	scrape_failed_alert::scrape_failed_alert(aux::stack_allocator& alloc
		, torrent_handle const& h
		, std::string const& u
		, error_code const& e)
		: tracker_alert(alloc, h, u)
#ifndef TORRENT_NO_DEPRECATE
		, msg(convert_from_native(e.message()))
#endif
		, error(e)
		, m_msg_idx(-1)
	{
		TORRENT_ASSERT(!u.empty());
	}
开发者ID:kevindhawkins,项目名称:libtorrent,代码行数:13,代码来源:alert.cpp

示例13: torrent_alert

	fastresume_rejected_alert::fastresume_rejected_alert(
		aux::stack_allocator& alloc
		, torrent_handle const& h
		, error_code const& ec
		, std::string const& file
		, char const* op)
		: torrent_alert(alloc, h)
		, error(ec)
#ifndef TORRENT_NO_DEPRECATE
		, file(file)
#endif
		, operation(op)
		, m_path_idx(alloc.copy_string(file))
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
开发者ID:bendikro,项目名称:libtorrent,代码行数:18,代码来源:alert.cpp

示例14: current_working_directory

	std::string current_working_directory()
	{
#ifdef TORRENT_WINDOWS
#if TORRENT_USE_WSTRING
		wchar_t cwd[TORRENT_MAX_PATH];
		_wgetcwd(cwd, sizeof(cwd) / sizeof(wchar_t));
#else
		char cwd[TORRENT_MAX_PATH];
		_getcwd(cwd, sizeof(cwd));
#endif // TORRENT_USE_WSTRING
#else
		char cwd[TORRENT_MAX_PATH];
		if (getcwd(cwd, sizeof(cwd)) == 0) return "/";
#endif
#if defined TORRENT_WINDOWS && TORRENT_USE_WSTRING
		return convert_from_wstring(cwd);
#else
		return convert_from_native(cwd);
#endif
	}
开发者ID:bird1015,项目名称:avplayer,代码行数:20,代码来源:file.cpp

示例15: if

	std::string add_torrent_alert::message() const
	{
		char msg[600];
		char info_hash[41];
		char const* torrent_name = info_hash;
		if (params.ti) torrent_name = params.ti->name().c_str();
		else if (!params.name.empty()) torrent_name = params.name.c_str();
		else if (!params.url.empty()) torrent_name = params.url.c_str();
		else to_hex(params.info_hash.data(), 20, info_hash);

		if (error)
		{
			snprintf(msg, sizeof(msg), "failed to add torrent \"%s\": [%s] %s"
				, torrent_name, error.category().name()
				, convert_from_native(error.message()).c_str());
		}
		else
		{
			snprintf(msg, sizeof(msg), "added torrent: %s", torrent_name);
		}
		return msg;
	}
开发者ID:kevindhawkins,项目名称:libtorrent,代码行数:22,代码来源:alert.cpp


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