field_kind.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_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. /// The field contains a string (`std::string` for `field` and `string_view` for
  26. /// `field_view`).
  27. string,
  28. /// The field contains a binary string (\ref blob for `field` and \ref blob_view for
  29. /// `field_view`).
  30. blob,
  31. /// The field contains a `float`.
  32. float_,
  33. /// The field contains a `double`.
  34. double_,
  35. /// The field contains a \ref date.
  36. date,
  37. /// The field contains a \ref datetime.
  38. datetime,
  39. /// The field contains a \ref time.
  40. time
  41. };
  42. /**
  43. * \brief Streams a field_kind.
  44. */
  45. BOOST_MYSQL_DECL
  46. std::ostream& operator<<(std::ostream& os, field_kind v);
  47. } // namespace mysql
  48. } // namespace boost
  49. #ifdef BOOST_MYSQL_HEADER_ONLY
  50. #include <boost/mysql/impl/field_kind.ipp>
  51. #endif
  52. #endif