resultset.ipp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_IMPL_RESULTSET_IPP
  8. #define BOOST_MYSQL_IMPL_RESULTSET_IPP
  9. #pragma once
  10. #include <boost/mysql/resultset.hpp>
  11. void boost::mysql::resultset::assign(resultset_view v)
  12. {
  13. has_value_ = v.has_value();
  14. if (has_value_)
  15. {
  16. meta_.assign(v.meta().begin(), v.meta().end());
  17. rws_ = v.rows();
  18. affected_rows_ = v.affected_rows();
  19. last_insert_id_ = v.last_insert_id();
  20. warnings_ = static_cast<std::uint16_t>(v.warning_count());
  21. info_.assign(v.info().begin(), v.info().end());
  22. is_out_params_ = v.is_out_params();
  23. }
  24. else
  25. {
  26. meta_.clear();
  27. rws_ = ::boost::mysql::rows();
  28. affected_rows_ = 0;
  29. last_insert_id_ = 0;
  30. warnings_ = 0;
  31. info_.clear();
  32. is_out_params_ = false;
  33. }
  34. }
  35. #endif