/Src/Dependencies/Boost/boost/asio/ssl/detail/verify_callback.hpp

http://hadesmem.googlecode.com/ · C++ Header · 70 lines · 45 code · 16 blank · 9 comment · 1 complexity · 2a0d07ae52dc0f1333697079b1d430e3 MD5 · raw file

  1. //
  2. // ssl/detail/verify_callback.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2011 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 BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP
  11. #define BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  17. # include <boost/asio/ssl/verify_context.hpp>
  18. #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  19. #include <boost/asio/detail/push_options.hpp>
  20. namespace boost {
  21. namespace asio {
  22. namespace ssl {
  23. namespace detail {
  24. #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  25. class verify_callback_base
  26. {
  27. public:
  28. virtual ~verify_callback_base()
  29. {
  30. }
  31. virtual bool call(bool preverified, verify_context& ctx) = 0;
  32. };
  33. template <typename VerifyCallback>
  34. class verify_callback : public verify_callback_base
  35. {
  36. public:
  37. explicit verify_callback(VerifyCallback callback)
  38. : callback_(callback)
  39. {
  40. }
  41. virtual bool call(bool preverified, verify_context& ctx)
  42. {
  43. return callback_(preverified, ctx);
  44. }
  45. private:
  46. VerifyCallback callback_;
  47. };
  48. #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  49. } // namespace detail
  50. } // namespace ssl
  51. } // namespace asio
  52. } // namespace boost
  53. #include <boost/asio/detail/pop_options.hpp>
  54. #endif // BOOST_ASIO_SSL_DETAIL_VERIFY_CALLBACK_HPP