field_kind.hpp 1.4 KB

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