Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.ipp 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // impl/error.ipp
  3. // ~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_IMPL_ERROR_IPP
  11. #define ASIO_IMPL_ERROR_IPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include <string>
  17. #include "asio/error.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace error {
  21. #if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
  22. namespace detail {
  23. class netdb_category : public asio::error_category
  24. {
  25. public:
  26. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  27. {
  28. return "asio.netdb";
  29. }
  30. std::string message(int value) const
  31. {
  32. if (value == error::host_not_found)
  33. return "Host not found (authoritative)";
  34. if (value == error::host_not_found_try_again)
  35. return "Host not found (non-authoritative), try again later";
  36. if (value == error::no_data)
  37. return "The query is valid, but it does not have associated data";
  38. if (value == error::no_recovery)
  39. return "A non-recoverable error occurred during database lookup";
  40. return "asio.netdb error";
  41. }
  42. };
  43. } // namespace detail
  44. const asio::error_category& get_netdb_category()
  45. {
  46. static detail::netdb_category instance;
  47. return instance;
  48. }
  49. namespace detail {
  50. class addrinfo_category : public asio::error_category
  51. {
  52. public:
  53. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  54. {
  55. return "asio.addrinfo";
  56. }
  57. std::string message(int value) const
  58. {
  59. if (value == error::service_not_found)
  60. return "Service not found";
  61. if (value == error::socket_type_not_supported)
  62. return "Socket type not supported";
  63. return "asio.addrinfo error";
  64. }
  65. };
  66. } // namespace detail
  67. const asio::error_category& get_addrinfo_category()
  68. {
  69. static detail::addrinfo_category instance;
  70. return instance;
  71. }
  72. #endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__)
  73. namespace detail {
  74. class misc_category : public asio::error_category
  75. {
  76. public:
  77. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  78. {
  79. return "asio.misc";
  80. }
  81. std::string message(int value) const
  82. {
  83. if (value == error::already_open)
  84. return "Already open";
  85. if (value == error::eof)
  86. return "End of file";
  87. if (value == error::not_found)
  88. return "Element not found";
  89. if (value == error::fd_set_failure)
  90. return "The descriptor does not fit into the select call's fd_set";
  91. return "asio.misc error";
  92. }
  93. };
  94. } // namespace detail
  95. const asio::error_category& get_misc_category()
  96. {
  97. static detail::misc_category instance;
  98. return instance;
  99. }
  100. } // namespace error
  101. } // namespace asio
  102. #include "asio/detail/pop_options.hpp"
  103. #endif // ASIO_IMPL_ERROR_IPP