コード例 #1
0
ファイル: file.cpp プロジェクト: bird1015/avplayer
	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
	}
コード例 #2
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	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;
	}
コード例 #3
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	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;
	}
コード例 #4
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	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
	}
コード例 #5
0
ファイル: alert.cpp プロジェクト: microIBM/libtorrent
	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;
	}
コード例 #6
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string file_rename_failed_alert::message() const
	{
		char ret[200 + TORRENT_MAX_PATH * 2];
		snprintf(ret, sizeof(ret), "%s: failed to rename file %d: %s"
			, torrent_alert::message().c_str(), index, convert_from_native(error.message()).c_str());
		return ret;
	}
コード例 #7
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	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());
	}
コード例 #8
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string rss_alert::message() const
	{
		char msg[600];
		char const* state_msg[] = {"updating", "updated", "error"};
		snprintf(msg, sizeof(msg), "RSS feed %s: %s (%s)"
			, url.c_str(), state_msg[state], convert_from_native(error.message()).c_str());
		return msg;
	}
コード例 #9
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	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()))
	{}
コード例 #10
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	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
	}
コード例 #11
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	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
	}
コード例 #12
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	fastresume_rejected_alert::fastresume_rejected_alert(torrent_handle const& h
		, error_code const& e)
		: torrent_alert(h)
		, error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
コード例 #13
0
ファイル: alert.cpp プロジェクト: microIBM/libtorrent
	std::string tracker_error_alert::message() const
	{
		char ret[400];
		snprintf(ret, sizeof(ret), "%s (%d) %s \"%s\" (%d)"
			, tracker_alert::message().c_str(), status_code
			, convert_from_native(error.message()).c_str(), error_message()
			, times_in_row);
		return ret;
	}
コード例 #14
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	torrent_delete_failed_alert::torrent_delete_failed_alert(torrent_handle const& h, error_code const& e, sha1_hash const& ih)
		: torrent_alert(h)
		, error(e)
		, info_hash(ih)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
コード例 #15
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string peer_error_alert::message() const
	{
		char buf[200];
		snprintf(buf, sizeof(buf), "%s peer error [%s] [%s]: %s"
			, peer_alert::message().c_str()
			, operation_name(operation), error.category().name()
			, convert_from_native(error.message()).c_str());
		return buf;
	}
コード例 #16
0
ファイル: error_code.cpp プロジェクト: AdamWill/twister-core
	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;
	}
コード例 #17
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string peer_disconnected_alert::message() const
	{
		char buf[600];
		snprintf(buf, sizeof(buf), "%s disconnecting (%s) [%s] [%s]: %s (reason: %d)"
			, peer_alert::message().c_str()
			, socket_type_str[socket_type]
			, operation_name(operation), error.category().name()
			, convert_from_native(error.message()).c_str()
			, int(reason));
		return buf;
	}
コード例 #18
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	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
	}
コード例 #19
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	url_seed_alert::url_seed_alert(aux::stack_allocator& alloc, torrent_handle const& h
		, std::string const& u, error_code const& e)
		: torrent_alert(alloc, h)
#ifndef TORRENT_NO_DEPRECATE
		, url(u)
		, msg(convert_from_native(e.message()))
#endif
		, error(e)
		, m_url_idx(alloc.copy_string(u))
		, m_msg_idx(-1)
	{}
コード例 #20
0
ファイル: alert.cpp プロジェクト: EricMyers47/OpenSpace
	file_error_alert::file_error_alert(
		std::string const& f
		, torrent_handle const& h
		, error_code const& e)
		: torrent_alert(h)
		, file(f)
		, error(e)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
コード例 #21
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	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());
	}
コード例 #22
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	peer_disconnected_alert::peer_disconnected_alert(aux::stack_allocator& alloc
		, torrent_handle const& h, tcp::endpoint const& ep
		, peer_id const& peer_id, operation_t op, int type, error_code const& e
		, close_reason_t r)
		: peer_alert(alloc, h, ep, peer_id)
		, socket_type(type)
		, operation(op)
		, error(e)
		, reason(r)
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
コード例 #23
0
ファイル: alert.cpp プロジェクト: microIBM/libtorrent
	std::string read_piece_alert::message() const
	{
		char msg[200];
		if (ec)
		{
			snprintf(msg, sizeof(msg), "%s: read_piece %u failed: %s"
				, torrent_alert::message().c_str() , piece
				, convert_from_native(ec.message()).c_str());
		}
		else
		{
			snprintf(msg, sizeof(msg), "%s: read_piece %u successful"
				, torrent_alert::message().c_str() , piece);
		}
		return msg;
	}
コード例 #24
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	file_error_alert::file_error_alert(aux::stack_allocator& alloc
		, error_code const& ec
		, std::string const& f
		, char const* op
		, torrent_handle const& h)
		: torrent_alert(alloc, h)
#ifndef TORRENT_NO_DEPRECATE
		, file(f)
#endif
		, error(ec)
		, operation(op)
		, m_file_idx(alloc.copy_string(f))
	{
#ifndef TORRENT_NO_DEPRECATE
		msg = convert_from_native(error.message());
#endif
	}
コード例 #25
0
ファイル: alert.cpp プロジェクト: bendikro/libtorrent
	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
	}
コード例 #26
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string listen_failed_alert::message() const
	{
		static char const* op_str[] =
		{
			"parse_addr",
			"open",
			"bind",
			"listen",
			"get_peer_name",
			"accept"
		};
		char ret[300];
		snprintf(ret, sizeof(ret), "listening on %s failed: [%s] [%s] %s"
			, listen_interface()
			, op_str[operation]
			, sock_type_str[sock_type]
			, convert_from_native(error.message()).c_str());
		return ret;
	}
コード例 #27
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	std::string dht_error_alert::message() const
	{
		static const char* const operation_names[] =
		{
			"unknown",
			"hostname lookup"
		};

		int op = operation;
		if (op < 0 || op >= int(sizeof(operation_names)/sizeof(operation_names[0])))
			op = 0;

		char msg[600];
		snprintf(msg, sizeof(msg), "DHT error [%s] (%d) %s"
			, operation_names[op]
			, error.value()
			, convert_from_native(error.message()).c_str());
		return msg;
	}
コード例 #28
0
ファイル: file.cpp プロジェクト: bird1015/avplayer
	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
	}
コード例 #29
0
ファイル: alert.cpp プロジェクト: microIBM/libtorrent
	std::string listen_failed_alert::message() const
	{
		static char const* op_str[] =
		{
			"parse_addr",
			"open",
			"bind",
			"listen",
			"get_socket_name",
			"accept",
			"enum_if",
			"bind_to_device"
		};
		char ret[300];
		snprintf(ret, sizeof(ret), "listening on %s (device: %s) failed: [%s] [%s] %s"
			, print_endpoint(endpoint).c_str()
			, listen_interface()
			, op_str[operation]
			, sock_type_str[sock_type]
			, convert_from_native(error.message()).c_str());
		return ret;
	}
コード例 #30
0
ファイル: alert.cpp プロジェクト: kevindhawkins/libtorrent
	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;
	}