field_kind.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // Copyright (c) 2019-2025 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_FIELD_KIND_HPP
  8. #define BOOST_MYSQL_FIELD_KIND_HPP
  9. #include <boost/mysql/detail/config.hpp>
  10. #include <iosfwd>
  11. namespace boost {
  12. namespace mysql {
  13. /**
  14. * \brief Represents the possible C++ types a `field` or `field_view` may have.
  15. */
  16. enum class field_kind
  17. {
  18. // Order here is important
  19. /// Any of the below when the value is NULL
  20. null = 0,
  21. /// The field contains a `std::int64_t`.
  22. int64,
  23. /// The field contains a `std::uint64_t`.
  24. uint64,
  25. /**
  26. * \brief The field contains a string (`std::string` for `field` and \ref string_view for
  27. * `field_view`).
  28. */
  29. string,
  30. /**
  31. * \brief The field contains a binary string (\ref blob for `field` and \ref blob_view for
  32. * `field_view`).
  33. */
  34. blob,
  35. /// The field contains a `float`.
  36. float_,
  37. /// The field contains a `double`.
  38. double_,
  39. /// The field contains a \ref date.
  40. date,
  41. /// The field contains a \ref datetime.
  42. datetime,
  43. /// The field contains a \ref time.
  44. time
  45. };
  46. /**
  47. * \brief Streams a field_kind.
  48. */
  49. BOOST_MYSQL_DECL
  50. std::ostream& operator<<(std::ostream& os, field_kind v);
  51. } // namespace mysql
  52. } // namespace boost
  53. #ifdef BOOST_MYSQL_HEADER_ONLY
  54. #include <boost/mysql/impl/field_kind.ipp>
  55. #endif
  56. #endif