1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-13 19:37:10 +02:00
Files
bin
cmake
module
Base
Core
Entity
Library
Misc
Vendor
AES256
ASIO
include
asio
detail
execution
experimental
generic
impl
ip
local
posix
ssl
traits
ts
windows
any_io_executor.hpp
associated_allocator.hpp
associated_executor.hpp
async_result.hpp
awaitable.hpp
basic_datagram_socket.hpp
basic_deadline_timer.hpp
basic_io_object.hpp
basic_raw_socket.hpp
basic_seq_packet_socket.hpp
basic_serial_port.hpp
basic_signal_set.hpp
basic_socket.hpp
basic_socket_acceptor.hpp
basic_socket_iostream.hpp
basic_socket_streambuf.hpp
basic_stream_socket.hpp
basic_streambuf.hpp
basic_streambuf_fwd.hpp
basic_waitable_timer.hpp
bind_executor.hpp
buffer.hpp
buffered_read_stream.hpp
buffered_read_stream_fwd.hpp
buffered_stream.hpp
buffered_stream_fwd.hpp
buffered_write_stream.hpp
buffered_write_stream_fwd.hpp
buffers_iterator.hpp
co_spawn.hpp
completion_condition.hpp
compose.hpp
connect.hpp
coroutine.hpp
deadline_timer.hpp
defer.hpp
detached.hpp
dispatch.hpp
error.hpp
error_code.hpp
execution.hpp
execution_context.hpp
executor.hpp
executor_work_guard.hpp
handler_alloc_hook.hpp
handler_continuation_hook.hpp
handler_invoke_hook.hpp
high_resolution_timer.hpp
io_context.hpp
io_context_strand.hpp
io_service.hpp
io_service_strand.hpp
is_applicable_property.hpp
is_executor.hpp
is_read_buffered.hpp
is_write_buffered.hpp
multiple_exceptions.hpp
packaged_task.hpp
placeholders.hpp
post.hpp
prefer.hpp
query.hpp
read.hpp
read_at.hpp
read_until.hpp
redirect_error.hpp
require.hpp
require_concept.hpp
serial_port.hpp
serial_port_base.hpp
signal_set.hpp
socket_base.hpp
spawn.hpp
ssl.hpp
static_thread_pool.hpp
steady_timer.hpp
strand.hpp
streambuf.hpp
system_context.hpp
system_error.hpp
system_executor.hpp
system_timer.hpp
this_coro.hpp
thread.hpp
thread_pool.hpp
time_traits.hpp
unyield.hpp
use_awaitable.hpp
use_future.hpp
uses_executor.hpp
version.hpp
wait_traits.hpp
write.hpp
write_at.hpp
yield.hpp
Makefile.am
asio.hpp
src
COPYING
INSTALL
LICENSE_1_0.txt
Makefile.am
README
asio.manifest
autogen.sh
boost_asio.manifest
boostify.pl
configure.ac
release.pl
tsify.pl
B64
CPR
CURL
CivetWeb
ConcurrentQueue
Fmt
Hash
MDBC
MaxmindDB
PUGIXML
SQLite
SimpleIni
SimpleSocket
SleepyDiscord
TinyDir
WebSocketPP
Whirlpool
ZLib
CMakeLists.txt
CMakeLists.txt
Core.cpp
Core.hpp
Logger.cpp
Logger.hpp
Main.cpp
Register.cpp
SqBase.hpp
sdk
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
SqMod/module/Vendor/ASIO/include/asio/system_error.hpp
2021-01-27 07:27:48 +02:00

132 lines
2.8 KiB
C++

//
// system_error.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ASIO_SYSTEM_ERROR_HPP
#define ASIO_SYSTEM_ERROR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
# include <system_error>
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
# include <cerrno>
# include <exception>
# include <string>
# include "asio/error_code.hpp"
# include "asio/detail/scoped_ptr.hpp"
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
#include "asio/detail/push_options.hpp"
namespace asio {
#if defined(ASIO_HAS_STD_SYSTEM_ERROR)
typedef std::system_error system_error;
#else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
/// The system_error class is used to represent system conditions that
/// prevent the library from operating correctly.
class system_error
: public std::exception
{
public:
/// Construct with an error code.
system_error(const error_code& ec)
: code_(ec),
context_()
{
}
/// Construct with an error code and context.
system_error(const error_code& ec, const std::string& context)
: code_(ec),
context_(context)
{
}
/// Copy constructor.
system_error(const system_error& other)
: std::exception(other),
code_(other.code_),
context_(other.context_),
what_()
{
}
/// Destructor.
virtual ~system_error() throw ()
{
}
/// Assignment operator.
system_error& operator=(const system_error& e)
{
context_ = e.context_;
code_ = e.code_;
what_.reset();
return *this;
}
/// Get a string representation of the exception.
virtual const char* what() const throw ()
{
#if !defined(ASIO_NO_EXCEPTIONS)
try
#endif // !defined(ASIO_NO_EXCEPTIONS)
{
if (!what_.get())
{
std::string tmp(context_);
if (tmp.length())
tmp += ": ";
tmp += code_.message();
what_.reset(new std::string(tmp));
}
return what_->c_str();
}
#if !defined(ASIO_NO_EXCEPTIONS)
catch (std::exception&)
{
return "system_error";
}
#endif // !defined(ASIO_NO_EXCEPTIONS)
}
/// Get the error code associated with the exception.
error_code code() const
{
return code_;
}
private:
// The code associated with the error.
error_code code_;
// The context associated with the error.
std::string context_;
// The string representation of the error.
mutable asio::detail::scoped_ptr<std::string> what_;
};
#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_SYSTEM_ERROR_HPP