date.ipp 739 B

12345678910111213141516171819202122232425262728
  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_DATE_IPP
  8. #define BOOST_MYSQL_IMPL_DATE_IPP
  9. #pragma once
  10. #include <boost/mysql/date.hpp>
  11. #include <boost/mysql/string_view.hpp>
  12. #include <boost/mysql/impl/internal/dt_to_string.hpp>
  13. #include <cstddef>
  14. #include <ostream>
  15. std::ostream& boost::mysql::operator<<(std::ostream& os, const date& value)
  16. {
  17. char buffer[32]{};
  18. std::size_t sz = detail::date_to_string(value.year(), value.month(), value.day(), buffer);
  19. return os << string_view(buffer, sz);
  20. }
  21. #endif