diff --git a/TODO.txt b/TODO.txt index a3c4fb69..96c51d97 100644 --- a/TODO.txt +++ b/TODO.txt @@ -37,7 +37,6 @@ Technical debt Rename (De)SerializationContext Test zero dates clear_errors() function to clear error_info and error_code at once - Review .hpp/.ipp convention Rework deserialize_row_fn to allow cursors Test prepared statement binding to procedure out params More thorough testing for several NULLs in integration testing diff --git a/examples/metadata.cpp b/examples/metadata.cpp index f77368ad..c1f18e10 100644 --- a/examples/metadata.cpp +++ b/examples/metadata.cpp @@ -1,5 +1,5 @@ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include #include #include diff --git a/examples/prepared_statements.cpp b/examples/prepared_statements.cpp index bc2ae072..9cf1a137 100644 --- a/examples/prepared_statements.cpp +++ b/examples/prepared_statements.cpp @@ -1,5 +1,5 @@ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include #include #include diff --git a/examples/query_async.cpp b/examples/query_async.cpp index 57cf3b58..b8ff0683 100644 --- a/examples/query_async.cpp +++ b/examples/query_async.cpp @@ -1,5 +1,5 @@ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include #include #include diff --git a/examples/query_sync.cpp b/examples/query_sync.cpp index fbdc27a9..8fc38746 100644 --- a/examples/query_sync.cpp +++ b/examples/query_sync.cpp @@ -1,5 +1,5 @@ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include #include #include diff --git a/include/mysql/collation.hpp b/include/boost/mysql/collation.hpp similarity index 100% rename from include/mysql/collation.hpp rename to include/boost/mysql/collation.hpp diff --git a/include/mysql/connection.hpp b/include/boost/mysql/connection.hpp similarity index 94% rename from include/mysql/connection.hpp rename to include/boost/mysql/connection.hpp index 6f5249b8..c9d71ce9 100644 --- a/include/mysql/connection.hpp +++ b/include/boost/mysql/connection.hpp @@ -1,12 +1,12 @@ #ifndef MYSQL_ASIO_CONNECTION_HPP #define MYSQL_ASIO_CONNECTION_HPP -#include "mysql/impl/channel.hpp" -#include "mysql/impl/network_algorithms/handshake.hpp" -#include "mysql/impl/basic_types.hpp" -#include "mysql/error.hpp" -#include "mysql/resultset.hpp" -#include "mysql/prepared_statement.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" +#include "boost/mysql/detail/network_algorithms/handshake.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/error.hpp" +#include "boost/mysql/resultset.hpp" +#include "boost/mysql/prepared_statement.hpp" #include namespace mysql @@ -156,6 +156,6 @@ constexpr unsigned short default_port = 3306; } -#include "mysql/impl/connection.ipp" +#include "boost/mysql/impl/connection.hpp" #endif diff --git a/include/mysql/impl/auth.ipp b/include/boost/mysql/detail/auth/impl/mysql_native_password.ipp similarity index 100% rename from include/mysql/impl/auth.ipp rename to include/boost/mysql/detail/auth/impl/mysql_native_password.ipp diff --git a/include/mysql/impl/auth.hpp b/include/boost/mysql/detail/auth/mysql_native_password.hpp similarity index 90% rename from include/mysql/impl/auth.hpp rename to include/boost/mysql/detail/auth/mysql_native_password.hpp index 307085ad..14f19738 100644 --- a/include/mysql/impl/auth.hpp +++ b/include/boost/mysql/detail/auth/mysql_native_password.hpp @@ -28,6 +28,6 @@ inline void compute_auth_string(std::string_view password, const void* challenge } // detail } // mysql -#include "mysql/impl/auth.ipp" +#include "boost/mysql/detail/auth/impl/mysql_native_password.ipp" #endif \ No newline at end of file diff --git a/include/mysql/impl/container_equals.hpp b/include/boost/mysql/detail/aux/container_equals.hpp similarity index 100% rename from include/mysql/impl/container_equals.hpp rename to include/boost/mysql/detail/aux/container_equals.hpp diff --git a/include/mysql/impl/stringize.hpp b/include/boost/mysql/detail/aux/stringize.hpp similarity index 57% rename from include/mysql/impl/stringize.hpp rename to include/boost/mysql/detail/aux/stringize.hpp index 093194f1..238f3015 100644 --- a/include/mysql/impl/stringize.hpp +++ b/include/boost/mysql/detail/aux/stringize.hpp @@ -1,5 +1,5 @@ -#ifndef INCLUDE_MYSQL_IMPL_STRINGIZE_HPP_ -#define INCLUDE_MYSQL_IMPL_STRINGIZE_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_AUX_STRINGIZE_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_AUX_STRINGIZE_HPP_ #include #include @@ -22,4 +22,4 @@ std::string stringize(const Types&... inputs) -#endif /* INCLUDE_MYSQL_IMPL_STRINGIZE_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_AUX_STRINGIZE_HPP_ */ diff --git a/include/mysql/impl/tmp.hpp b/include/boost/mysql/detail/aux/tmp.hpp similarity index 75% rename from include/mysql/impl/tmp.hpp rename to include/boost/mysql/detail/aux/tmp.hpp index 31e5e5fd..55f09a64 100644 --- a/include/mysql/impl/tmp.hpp +++ b/include/boost/mysql/detail/aux/tmp.hpp @@ -1,5 +1,5 @@ -#ifndef INCLUDE_MYSQL_IMPL_TMP_HPP_ -#define INCLUDE_MYSQL_IMPL_TMP_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_AUX_TMP_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_AUX_TMP_HPP_ #include @@ -29,4 +29,4 @@ constexpr bool is_one_of_v = is_one_of::value; -#endif /* INCLUDE_MYSQL_IMPL_TMP_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_AUX_TMP_HPP_ */ diff --git a/include/mysql/impl/basic_types.hpp b/include/boost/mysql/detail/basic_types.hpp similarity index 100% rename from include/mysql/impl/basic_types.hpp rename to include/boost/mysql/detail/basic_types.hpp diff --git a/include/mysql/impl/network_algorithms/close_statement.hpp b/include/boost/mysql/detail/network_algorithms/close_statement.hpp similarity index 54% rename from include/mysql/impl/network_algorithms/close_statement.hpp rename to include/boost/mysql/detail/network_algorithms/close_statement.hpp index 94948427..c9cef171 100644 --- a/include/mysql/impl/network_algorithms/close_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/close_statement.hpp @@ -1,7 +1,7 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" namespace mysql { @@ -27,6 +27,6 @@ async_close_statement( } } -#include "mysql/impl/network_algorithms/close_statement.ipp" +#include "boost/mysql/detail/network_algorithms/impl/close_statement.hpp" -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP_ */ diff --git a/include/boost/mysql/detail/network_algorithms/common.hpp b/include/boost/mysql/detail/network_algorithms/common.hpp new file mode 100644 index 00000000..93f2595a --- /dev/null +++ b/include/boost/mysql/detail/network_algorithms/common.hpp @@ -0,0 +1,27 @@ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP_ + +#include +#include +#include "boost/mysql/error.hpp" +#include "boost/mysql/metadata.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" + +namespace mysql +{ +namespace detail +{ + +using deserialize_row_fn = error_code (*)( + DeserializationContext&, + const std::vector&, + std::vector& +); + +} +} + + + +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/execute_generic.hpp b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp similarity index 83% rename from include/mysql/impl/network_algorithms/execute_generic.hpp rename to include/boost/mysql/detail/network_algorithms/execute_generic.hpp index 80092b66..38738d47 100644 --- a/include/mysql/impl/network_algorithms/execute_generic.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp @@ -1,8 +1,8 @@ #ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_RESULTSET_HEAD_HPP_ #define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_RESULTSET_HEAD_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" -#include "mysql/resultset.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" +#include "boost/mysql/resultset.hpp" #include namespace mysql @@ -32,6 +32,6 @@ async_execute_generic( } } -#include "mysql/impl/network_algorithms/execute_generic.ipp" +#include "boost/mysql/detail/network_algorithms/impl/execute_generic.hpp" #endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_RESULTSET_HEAD_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/execute_query.hpp b/include/boost/mysql/detail/network_algorithms/execute_query.hpp similarity index 56% rename from include/mysql/impl/network_algorithms/execute_query.hpp rename to include/boost/mysql/detail/network_algorithms/execute_query.hpp index d153a8a0..eb2b282d 100644 --- a/include/mysql/impl/network_algorithms/execute_query.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_query.hpp @@ -1,8 +1,8 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" -#include "mysql/resultset.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" +#include "boost/mysql/resultset.hpp" #include namespace mysql @@ -30,6 +30,6 @@ async_execute_query( } } -#include "mysql/impl/network_algorithms/execute_query.ipp" +#include "boost/mysql/detail/network_algorithms/impl/execute_query.hpp" -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/execute_statement.hpp b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp similarity index 60% rename from include/mysql/impl/network_algorithms/execute_statement.hpp rename to include/boost/mysql/detail/network_algorithms/execute_statement.hpp index 54d306fb..0261b357 100644 --- a/include/mysql/impl/network_algorithms/execute_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp @@ -1,9 +1,9 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" -#include "mysql/resultset.hpp" -#include "mysql/value.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" +#include "boost/mysql/resultset.hpp" +#include "boost/mysql/value.hpp" namespace mysql { @@ -34,6 +34,6 @@ async_execute_statement( } } -#include "mysql/impl/network_algorithms/execute_statement.ipp" +#include "boost/mysql/detail/network_algorithms/impl/execute_statement.hpp" -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/handshake.hpp b/include/boost/mysql/detail/network_algorithms/handshake.hpp similarity index 77% rename from include/mysql/impl/network_algorithms/handshake.hpp rename to include/boost/mysql/detail/network_algorithms/handshake.hpp index 794815c7..163606bf 100644 --- a/include/mysql/impl/network_algorithms/handshake.hpp +++ b/include/boost/mysql/detail/network_algorithms/handshake.hpp @@ -2,9 +2,9 @@ #define MYSQL_ASIO_IMPL_HANDSHAKE_HPP #include -#include "mysql/impl/channel.hpp" -#include "mysql/impl/basic_types.hpp" -#include "mysql/collation.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/collation.hpp" namespace mysql { @@ -38,7 +38,7 @@ async_handshake( } } -#include "mysql/impl/network_algorithms/handshake.ipp" +#include "boost/mysql/detail/network_algorithms/impl/handshake.hpp" #endif diff --git a/include/mysql/impl/network_algorithms/close_statement.ipp b/include/boost/mysql/detail/network_algorithms/impl/close_statement.hpp similarity index 87% rename from include/mysql/impl/network_algorithms/close_statement.ipp rename to include/boost/mysql/detail/network_algorithms/impl/close_statement.hpp index 000ac1e5..6a135b25 100644 --- a/include/mysql/impl/network_algorithms/close_statement.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/close_statement.hpp @@ -1,5 +1,5 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_IPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_CLOSE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_CLOSE_STATEMENT_HPP_ #include #include @@ -70,4 +70,4 @@ mysql::detail::async_close_statement( } -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_CLOSE_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/execute_generic.ipp b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp similarity index 98% rename from include/mysql/impl/network_algorithms/execute_generic.ipp rename to include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp index a335773c..d0801b28 100644 --- a/include/mysql/impl/network_algorithms/execute_generic.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp @@ -1,8 +1,8 @@ #ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_RESULTSET_HEAD_IPP_ #define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_RESULTSET_HEAD_IPP_ -#include "mysql/impl/messages.hpp" -#include "mysql/impl/serialization.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" #include #include diff --git a/include/mysql/impl/network_algorithms/execute_query.ipp b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp similarity index 68% rename from include/mysql/impl/network_algorithms/execute_query.ipp rename to include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp index 87914afe..624ac1a3 100644 --- a/include/mysql/impl/network_algorithms/execute_query.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp @@ -1,8 +1,8 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_IPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_QUERY_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_QUERY_HPP_ -#include "mysql/impl/network_algorithms/execute_generic.hpp" -#include "mysql/impl/text_deserialization.hpp" +#include "boost/mysql/detail/network_algorithms/execute_generic.hpp" +#include "boost/mysql/detail/protocol/text_deserialization.hpp" template void mysql::detail::execute_query( @@ -36,4 +36,4 @@ mysql::detail::async_execute_query( #include -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_QUERY_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_QUERY_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/execute_statement.ipp b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp similarity index 79% rename from include/mysql/impl/network_algorithms/execute_statement.ipp rename to include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp index 89dc3ba7..c38968b5 100644 --- a/include/mysql/impl/network_algorithms/execute_statement.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp @@ -1,8 +1,8 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_IPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_STATEMENT_HPP_ -#include "mysql/impl/network_algorithms/execute_generic.hpp" -#include "mysql/impl/binary_deserialization.hpp" +#include "boost/mysql/detail/network_algorithms/execute_generic.hpp" +#include "boost/mysql/detail/protocol/binary_deserialization.hpp" namespace mysql { @@ -63,4 +63,4 @@ mysql::detail::async_execute_statement( -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_EXECUTE_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/handshake.ipp b/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp similarity index 97% rename from include/mysql/impl/network_algorithms/handshake.ipp rename to include/boost/mysql/detail/network_algorithms/impl/handshake.hpp index 72569530..5006daa9 100644 --- a/include/mysql/impl/network_algorithms/handshake.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp @@ -1,10 +1,10 @@ #ifndef MYSQL_ASIO_IMPL_HANDSHAKE_IPP #define MYSQL_ASIO_IMPL_HANDSHAKE_IPP -#include "mysql/impl/capabilities.hpp" -#include "mysql/impl/auth.hpp" -#include "mysql/impl/serialization.hpp" -#include "mysql/impl/network_algorithms/common.hpp" +#include "boost/mysql/detail/protocol/capabilities.hpp" +#include "boost/mysql/detail/auth/mysql_native_password.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" #include namespace mysql diff --git a/include/mysql/impl/network_algorithms/prepare_statement.ipp b/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp similarity index 95% rename from include/mysql/impl/network_algorithms/prepare_statement.ipp rename to include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp index c87c38d3..5219bea0 100644 --- a/include/mysql/impl/network_algorithms/prepare_statement.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp @@ -1,5 +1,5 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_IPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_PREPARE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_PREPARE_STATEMENT_HPP_ #include @@ -219,4 +219,4 @@ mysql::detail::async_prepare_statement( #include -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_IMPL_PREPARE_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/read_row.ipp b/include/boost/mysql/detail/network_algorithms/impl/read_row.hpp similarity index 98% rename from include/mysql/impl/network_algorithms/read_row.ipp rename to include/boost/mysql/detail/network_algorithms/impl/read_row.hpp index bd3ddba8..5d24f605 100644 --- a/include/mysql/impl/network_algorithms/read_row.ipp +++ b/include/boost/mysql/detail/network_algorithms/impl/read_row.hpp @@ -1,7 +1,7 @@ #ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_TEXT_ROW_IPP_ #define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_TEXT_ROW_IPP_ -#include "mysql/impl/text_deserialization.hpp" +#include "boost/mysql/detail/protocol/text_deserialization.hpp" #include namespace mysql diff --git a/include/mysql/impl/network_algorithms/prepare_statement.hpp b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp similarity index 55% rename from include/mysql/impl/network_algorithms/prepare_statement.hpp rename to include/boost/mysql/detail/network_algorithms/prepare_statement.hpp index 8d601bab..8252baa6 100644 --- a/include/mysql/impl/network_algorithms/prepare_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp @@ -1,8 +1,8 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" -#include "mysql/prepared_statement.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" +#include "boost/mysql/prepared_statement.hpp" namespace mysql { @@ -29,6 +29,6 @@ async_prepare_statement( } } -#include "mysql/impl/network_algorithms/prepare_statement.ipp" +#include "boost/mysql/detail/network_algorithms/impl/prepare_statement.hpp" -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/read_row.hpp b/include/boost/mysql/detail/network_algorithms/read_row.hpp similarity index 86% rename from include/mysql/impl/network_algorithms/read_row.hpp rename to include/boost/mysql/detail/network_algorithms/read_row.hpp index b408d7b3..aef57b6f 100644 --- a/include/mysql/impl/network_algorithms/read_row.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_row.hpp @@ -1,8 +1,8 @@ #ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_TEXT_ROW_HPP_ #define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_READ_TEXT_ROW_HPP_ -#include "mysql/impl/network_algorithms/common.hpp" -#include "mysql/metadata.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" +#include "boost/mysql/metadata.hpp" #include #include @@ -46,7 +46,7 @@ async_read_row( } } -#include "mysql/impl/network_algorithms/read_row.ipp" +#include "boost/mysql/detail/network_algorithms/impl/read_row.hpp" diff --git a/include/boost/mysql/detail/protocol/binary_deserialization.hpp b/include/boost/mysql/detail/protocol/binary_deserialization.hpp new file mode 100644 index 00000000..f3c379f0 --- /dev/null +++ b/include/boost/mysql/detail/protocol/binary_deserialization.hpp @@ -0,0 +1,32 @@ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_DESERIALIZATION_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_DESERIALIZATION_HPP_ + +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/error.hpp" +#include "boost/mysql/value.hpp" +#include "boost/mysql/metadata.hpp" +#include + +namespace mysql +{ +namespace detail +{ + +inline Error deserialize_binary_value( + DeserializationContext& ctx, + const field_metadata& meta, + value& output +); + +inline error_code deserialize_binary_row( + DeserializationContext& ctx, + const std::vector& meta, + std::vector& output +); + +} +} + +#include "boost/mysql/detail/protocol/impl/binary_deserialization.ipp" + +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_DESERIALIZATION_HPP_ */ diff --git a/include/mysql/impl/binary_serialization.hpp b/include/boost/mysql/detail/protocol/binary_serialization.hpp similarity index 73% rename from include/mysql/impl/binary_serialization.hpp rename to include/boost/mysql/detail/protocol/binary_serialization.hpp index c83783b5..c2795ed7 100644 --- a/include/mysql/impl/binary_serialization.hpp +++ b/include/boost/mysql/detail/protocol/binary_serialization.hpp @@ -1,8 +1,8 @@ -#ifndef INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_HPP_ -#define INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_SERIALIZATION_HPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_SERIALIZATION_HPP_ -#include "mysql/impl/serialization.hpp" -#include "mysql/value.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/value.hpp" // (de)serialization overloads for date/time types and mysql::value @@ -29,6 +29,6 @@ inline void serialize(const value& input, SerializationContext& ctx) noexcept; } } -#include "mysql/impl/binary_serialization.ipp" +#include "boost/mysql/detail/protocol/impl/binary_serialization.ipp" -#endif /* INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_BINARY_SERIALIZATION_HPP_ */ diff --git a/include/mysql/impl/capabilities.hpp b/include/boost/mysql/detail/protocol/capabilities.hpp similarity index 100% rename from include/mysql/impl/capabilities.hpp rename to include/boost/mysql/detail/protocol/capabilities.hpp diff --git a/include/mysql/impl/channel.hpp b/include/boost/mysql/detail/protocol/channel.hpp similarity index 91% rename from include/mysql/impl/channel.hpp rename to include/boost/mysql/detail/protocol/channel.hpp index 2bcae217..cb48c736 100644 --- a/include/mysql/impl/channel.hpp +++ b/include/boost/mysql/detail/protocol/channel.hpp @@ -1,9 +1,9 @@ #ifndef MYSQL_ASIO_IMPL_CHANNEL_HPP #define MYSQL_ASIO_IMPL_CHANNEL_HPP -#include "mysql/error.hpp" -#include "mysql/impl/basic_types.hpp" -#include "mysql/impl/capabilities.hpp" +#include "boost/mysql/error.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/detail/protocol/capabilities.hpp" #include #include #include @@ -64,6 +64,6 @@ using channel_stream_type = typename ChannelType::stream_type; } } -#include "mysql/impl/channel.ipp" +#include "boost/mysql/detail/protocol/impl/channel.hpp" #endif diff --git a/include/mysql/impl/constants.hpp b/include/boost/mysql/detail/protocol/constants.hpp similarity index 98% rename from include/mysql/impl/constants.hpp rename to include/boost/mysql/detail/protocol/constants.hpp index 5d3de381..32a29881 100644 --- a/include/mysql/impl/constants.hpp +++ b/include/boost/mysql/detail/protocol/constants.hpp @@ -1,7 +1,7 @@ #ifndef MYSQL_ASIO_IMPL_CONSTANTS_HPP #define MYSQL_ASIO_IMPL_CONSTANTS_HPP -#include "mysql/impl/basic_types.hpp" +#include "boost/mysql/detail/basic_types.hpp" namespace mysql { diff --git a/include/mysql/impl/binary_deserialization.ipp b/include/boost/mysql/detail/protocol/impl/binary_deserialization.ipp similarity index 92% rename from include/mysql/impl/binary_deserialization.ipp rename to include/boost/mysql/detail/protocol/impl/binary_deserialization.ipp index 96ca4d97..b2a98dbc 100644 --- a/include/mysql/impl/binary_deserialization.ipp +++ b/include/boost/mysql/detail/protocol/impl/binary_deserialization.ipp @@ -1,9 +1,9 @@ -#ifndef INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_IPP_ -#define INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_DESERIALIZATION_IPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_DESERIALIZATION_IPP_ #include -#include "mysql/impl/null_bitmap_traits.hpp" -#include "mysql/impl/tmp.hpp" +#include "boost/mysql/detail/protocol/null_bitmap_traits.hpp" +#include "boost/mysql/detail/aux/tmp.hpp" namespace mysql { @@ -159,4 +159,4 @@ inline mysql::error_code mysql::detail::deserialize_binary_row( } -#endif /* INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_DESERIALIZATION_IPP_ */ diff --git a/include/mysql/impl/binary_serialization.ipp b/include/boost/mysql/detail/protocol/impl/binary_serialization.ipp similarity index 97% rename from include/mysql/impl/binary_serialization.ipp rename to include/boost/mysql/detail/protocol/impl/binary_serialization.ipp index fcf7d529..8426b7a3 100644 --- a/include/mysql/impl/binary_serialization.ipp +++ b/include/boost/mysql/detail/protocol/impl/binary_serialization.ipp @@ -1,5 +1,5 @@ -#ifndef INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_IPP_ -#define INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_SERIALIZATION_IPP_ +#define INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_SERIALIZATION_IPP_ #include @@ -341,4 +341,4 @@ inline void mysql::detail::serialize( -#endif /* INCLUDE_MYSQL_IMPL_BINARY_SERIALIZATION_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_IMPL_BINARY_SERIALIZATION_IPP_ */ diff --git a/include/mysql/impl/channel.ipp b/include/boost/mysql/detail/protocol/impl/channel.hpp similarity index 98% rename from include/mysql/impl/channel.ipp rename to include/boost/mysql/detail/protocol/impl/channel.hpp index fccf4dc5..891cd1e2 100644 --- a/include/mysql/impl/channel.ipp +++ b/include/boost/mysql/detail/protocol/impl/channel.hpp @@ -5,8 +5,8 @@ #include #include #include -#include "mysql/impl/messages.hpp" -#include "mysql/impl/constants.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/protocol/constants.hpp" #include namespace mysql diff --git a/include/mysql/impl/messages.ipp b/include/boost/mysql/detail/protocol/impl/messages.ipp similarity index 98% rename from include/mysql/impl/messages.ipp rename to include/boost/mysql/detail/protocol/impl/messages.ipp index dec97c5d..992a5ba5 100644 --- a/include/mysql/impl/messages.ipp +++ b/include/boost/mysql/detail/protocol/impl/messages.ipp @@ -1,9 +1,9 @@ #ifndef MYSQL_ASIO_IMPL_MESSAGES_IPP #define MYSQL_ASIO_IMPL_MESSAGES_IPP -#include "mysql/impl/serialization.hpp" -#include "mysql/impl/null_bitmap_traits.hpp" -#include "mysql/impl/binary_serialization.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/detail/protocol/null_bitmap_traits.hpp" +#include "boost/mysql/detail/protocol/binary_serialization.hpp" #include #include diff --git a/include/mysql/impl/text_deserialization.ipp b/include/boost/mysql/detail/protocol/impl/text_deserialization.ipp similarity index 100% rename from include/mysql/impl/text_deserialization.ipp rename to include/boost/mysql/detail/protocol/impl/text_deserialization.ipp diff --git a/include/mysql/impl/messages.hpp b/include/boost/mysql/detail/protocol/messages.hpp similarity index 96% rename from include/mysql/impl/messages.hpp rename to include/boost/mysql/detail/protocol/messages.hpp index bb2ad80b..08ad869a 100644 --- a/include/mysql/impl/messages.hpp +++ b/include/boost/mysql/detail/protocol/messages.hpp @@ -1,11 +1,11 @@ #ifndef MYSQL_ASIO_IMPL_MESSAGES_HPP #define MYSQL_ASIO_IMPL_MESSAGES_HPP -#include "mysql/impl/serialization.hpp" -#include "mysql/impl/basic_types.hpp" -#include "mysql/impl/constants.hpp" -#include "mysql/collation.hpp" -#include "mysql/value.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/detail/protocol/constants.hpp" +#include "boost/mysql/collation.hpp" +#include "boost/mysql/value.hpp" #include #include #include @@ -340,7 +340,7 @@ inline error_code process_error_packet(DeserializationContext& ctx, error_info& } // detail } // mysql -#include "mysql/impl/messages.ipp" +#include "boost/mysql/detail/protocol/impl/messages.ipp" #endif diff --git a/include/mysql/impl/null_bitmap_traits.hpp b/include/boost/mysql/detail/protocol/null_bitmap_traits.hpp similarity index 100% rename from include/mysql/impl/null_bitmap_traits.hpp rename to include/boost/mysql/detail/protocol/null_bitmap_traits.hpp diff --git a/include/mysql/impl/serialization.hpp b/include/boost/mysql/detail/protocol/serialization.hpp similarity index 99% rename from include/mysql/impl/serialization.hpp rename to include/boost/mysql/detail/protocol/serialization.hpp index 8dda1904..eb36e8e1 100644 --- a/include/mysql/impl/serialization.hpp +++ b/include/boost/mysql/detail/protocol/serialization.hpp @@ -9,9 +9,9 @@ #include #include #include -#include "mysql/impl/basic_types.hpp" -#include "mysql/impl/capabilities.hpp" -#include "mysql/error.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/detail/protocol/capabilities.hpp" +#include "boost/mysql/error.hpp" namespace mysql { diff --git a/include/mysql/impl/text_deserialization.hpp b/include/boost/mysql/detail/protocol/text_deserialization.hpp similarity index 64% rename from include/mysql/impl/text_deserialization.hpp rename to include/boost/mysql/detail/protocol/text_deserialization.hpp index aafb5255..b3c89e79 100644 --- a/include/mysql/impl/text_deserialization.hpp +++ b/include/boost/mysql/detail/protocol/text_deserialization.hpp @@ -1,10 +1,10 @@ #ifndef MYSQL_ASIO_IMPL_DESERIALIZE_ROW_HPP #define MYSQL_ASIO_IMPL_DESERIALIZE_ROW_HPP -#include "mysql/impl/serialization.hpp" -#include "mysql/error.hpp" -#include "mysql/value.hpp" -#include "mysql/metadata.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/error.hpp" +#include "boost/mysql/value.hpp" +#include "boost/mysql/metadata.hpp" #include namespace mysql @@ -27,6 +27,6 @@ inline error_code deserialize_text_row( } } -#include "mysql/impl/text_deserialization.ipp" +#include "boost/mysql/detail/protocol/impl/text_deserialization.ipp" #endif diff --git a/include/mysql/error.hpp b/include/boost/mysql/error.hpp similarity index 94% rename from include/mysql/error.hpp rename to include/boost/mysql/error.hpp index 7fd47bea..c36a3c7f 100644 --- a/include/mysql/error.hpp +++ b/include/boost/mysql/error.hpp @@ -14,7 +14,7 @@ enum class Error : int ok = 0, // Server returned errors - #include "mysql/impl/server_error_enum.hpp" + #include "boost/mysql/impl/server_error_enum.hpp" // Protocol errors incomplete_message = 0x10000, @@ -60,6 +60,6 @@ inline std::ostream& operator<<(std::ostream& os, const error_info& v) { return } -#include "mysql/impl/error.hpp" +#include "boost/mysql/impl/error.hpp" #endif diff --git a/include/mysql/field_type.hpp b/include/boost/mysql/field_type.hpp similarity index 100% rename from include/mysql/field_type.hpp rename to include/boost/mysql/field_type.hpp diff --git a/include/mysql/impl/connection.ipp b/include/boost/mysql/impl/connection.hpp similarity index 94% rename from include/mysql/impl/connection.ipp rename to include/boost/mysql/impl/connection.hpp index 6025e89e..b15f662f 100644 --- a/include/mysql/impl/connection.ipp +++ b/include/boost/mysql/impl/connection.hpp @@ -1,9 +1,9 @@ #ifndef MYSQL_ASIO_IMPL_CONNECTION_IPP #define MYSQL_ASIO_IMPL_CONNECTION_IPP -#include "mysql/impl/network_algorithms/handshake.hpp" -#include "mysql/impl/network_algorithms/execute_query.hpp" -#include "mysql/impl/network_algorithms/prepare_statement.hpp" +#include "boost/mysql/detail/network_algorithms/handshake.hpp" +#include "boost/mysql/detail/network_algorithms/execute_query.hpp" +#include "boost/mysql/detail/network_algorithms/prepare_statement.hpp" #include namespace mysql diff --git a/include/mysql/impl/error.hpp b/include/boost/mysql/impl/error.hpp similarity index 96% rename from include/mysql/impl/error.hpp rename to include/boost/mysql/impl/error.hpp index 33bd3a6e..99857c98 100644 --- a/include/mysql/impl/error.hpp +++ b/include/boost/mysql/impl/error.hpp @@ -37,7 +37,7 @@ inline const char* error_to_string(Error error) noexcept case Error::unknown_auth_plugin: return "The user employs an authentication plugin unknown to the client"; case Error::wrong_num_params: return "The provided parameter count does not match the prepared statement parameter count"; - #include "mysql/impl/server_error_descriptions.hpp" + #include "boost/mysql/impl/server_error_descriptions.hpp" default: return ""; } diff --git a/include/mysql/impl/metadata.hpp b/include/boost/mysql/impl/metadata.ipp similarity index 100% rename from include/mysql/impl/metadata.hpp rename to include/boost/mysql/impl/metadata.ipp diff --git a/include/mysql/impl/prepared_statement.ipp b/include/boost/mysql/impl/prepared_statement.hpp similarity index 89% rename from include/mysql/impl/prepared_statement.ipp rename to include/boost/mysql/impl/prepared_statement.hpp index 8281a88e..334f4d29 100644 --- a/include/mysql/impl/prepared_statement.ipp +++ b/include/boost/mysql/impl/prepared_statement.hpp @@ -1,9 +1,9 @@ -#ifndef INCLUDE_MYSQL_IMPL_PREPARED_STATEMENT_IPP_ -#define INCLUDE_MYSQL_IMPL_PREPARED_STATEMENT_IPP_ +#ifndef INCLUDE_BOOST_MYSQL_IMPL_PREPARED_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_IMPL_PREPARED_STATEMENT_HPP_ -#include "mysql/impl/network_algorithms/execute_statement.hpp" -#include "mysql/impl/network_algorithms/close_statement.hpp" -#include "mysql/impl/stringize.hpp" +#include "boost/mysql/detail/network_algorithms/execute_statement.hpp" +#include "boost/mysql/detail/network_algorithms/close_statement.hpp" +#include "boost/mysql/detail/aux/stringize.hpp" #include template @@ -141,4 +141,4 @@ auto mysql::prepared_statement::async_close( return detail::async_close_statement(*channel_, id(), std::forward(token)); } -#endif /* INCLUDE_MYSQL_IMPL_PREPARED_STATEMENT_IPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_IMPL_PREPARED_STATEMENT_HPP_ */ diff --git a/include/mysql/impl/resultset.ipp b/include/boost/mysql/impl/resultset.hpp similarity index 99% rename from include/mysql/impl/resultset.ipp rename to include/boost/mysql/impl/resultset.hpp index 6e7c7f85..0c03e829 100644 --- a/include/mysql/impl/resultset.ipp +++ b/include/boost/mysql/impl/resultset.hpp @@ -1,7 +1,7 @@ #ifndef MYSQL_ASIO_IMPL_RESULTSET_HPP #define MYSQL_ASIO_IMPL_RESULTSET_HPP -#include "mysql/impl/network_algorithms/read_row.hpp" +#include "boost/mysql/detail/network_algorithms/read_row.hpp" #include #include #include diff --git a/include/mysql/impl/server_error_descriptions.hpp b/include/boost/mysql/impl/server_error_descriptions.hpp similarity index 100% rename from include/mysql/impl/server_error_descriptions.hpp rename to include/boost/mysql/impl/server_error_descriptions.hpp diff --git a/include/mysql/impl/server_error_enum.hpp b/include/boost/mysql/impl/server_error_enum.hpp similarity index 100% rename from include/mysql/impl/server_error_enum.hpp rename to include/boost/mysql/impl/server_error_enum.hpp diff --git a/include/mysql/impl/value.hpp b/include/boost/mysql/impl/value.hpp similarity index 98% rename from include/mysql/impl/value.hpp rename to include/boost/mysql/impl/value.hpp index a96ec4d2..f10745ee 100644 --- a/include/mysql/impl/value.hpp +++ b/include/boost/mysql/impl/value.hpp @@ -1,7 +1,7 @@ #ifndef MYSQL_ASIO_IMPL_VALUE_HPP #define MYSQL_ASIO_IMPL_VALUE_HPP -#include "mysql/impl/container_equals.hpp" +#include "boost/mysql/detail/aux/container_equals.hpp" namespace mysql { diff --git a/include/mysql/metadata.hpp b/include/boost/mysql/metadata.hpp similarity index 96% rename from include/mysql/metadata.hpp rename to include/boost/mysql/metadata.hpp index 00056c6c..b0c86081 100644 --- a/include/mysql/metadata.hpp +++ b/include/boost/mysql/metadata.hpp @@ -1,9 +1,9 @@ #ifndef MYSQL_ASIO_METADATA_HPP #define MYSQL_ASIO_METADATA_HPP -#include "mysql/impl/messages.hpp" -#include "mysql/impl/basic_types.hpp" -#include "mysql/field_type.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/field_type.hpp" namespace mysql { @@ -119,6 +119,6 @@ public: } // detail } // mysql -#include "mysql/impl/metadata.hpp" +#include "boost/mysql/impl/metadata.ipp" #endif diff --git a/include/mysql/prepared_statement.hpp b/include/boost/mysql/prepared_statement.hpp similarity index 94% rename from include/mysql/prepared_statement.hpp rename to include/boost/mysql/prepared_statement.hpp index b7e698ea..c084cc35 100644 --- a/include/mysql/prepared_statement.hpp +++ b/include/boost/mysql/prepared_statement.hpp @@ -1,9 +1,9 @@ -#ifndef INCLUDE_MYSQL_PREPARED_STATEMENT_HPP_ -#define INCLUDE_MYSQL_PREPARED_STATEMENT_HPP_ +#ifndef INCLUDE_BOOST_MYSQL_PREPARED_STATEMENT_HPP_ +#define INCLUDE_BOOST_MYSQL_PREPARED_STATEMENT_HPP_ -#include "mysql/resultset.hpp" -#include "mysql/impl/channel.hpp" -#include "mysql/impl/messages.hpp" +#include "boost/mysql/resultset.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" #include namespace mysql @@ -146,6 +146,6 @@ using tcp_prepared_statement = prepared_statement; } -#include "mysql/impl/prepared_statement.ipp" +#include "boost/mysql/impl/prepared_statement.hpp" -#endif /* INCLUDE_MYSQL_PREPARED_STATEMENT_HPP_ */ +#endif /* INCLUDE_BOOST_MYSQL_PREPARED_STATEMENT_HPP_ */ diff --git a/include/mysql/resultset.hpp b/include/boost/mysql/resultset.hpp similarity index 95% rename from include/mysql/resultset.hpp rename to include/boost/mysql/resultset.hpp index 8fe7b1c5..929d228d 100644 --- a/include/mysql/resultset.hpp +++ b/include/boost/mysql/resultset.hpp @@ -1,11 +1,11 @@ #ifndef MYSQL_ASIO_RESULTSET_HPP #define MYSQL_ASIO_RESULTSET_HPP -#include "mysql/row.hpp" -#include "mysql/metadata.hpp" -#include "mysql/impl/messages.hpp" -#include "mysql/impl/channel.hpp" -#include "mysql/impl/network_algorithms/common.hpp" // deserialize_row_fn +#include "boost/mysql/row.hpp" +#include "boost/mysql/metadata.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" +#include "boost/mysql/detail/network_algorithms/common.hpp" // deserialize_row_fn #include #include @@ -179,6 +179,6 @@ using tcp_resultset = resultset; } -#include "mysql/impl/resultset.ipp" +#include "boost/mysql/impl/resultset.hpp" #endif diff --git a/include/mysql/row.hpp b/include/boost/mysql/row.hpp similarity index 94% rename from include/mysql/row.hpp rename to include/boost/mysql/row.hpp index fea175c3..2e33b0d2 100644 --- a/include/mysql/row.hpp +++ b/include/boost/mysql/row.hpp @@ -1,10 +1,10 @@ #ifndef MYSQL_ASIO_ROW_HPP #define MYSQL_ASIO_ROW_HPP -#include "mysql/impl/basic_types.hpp" -#include "mysql/value.hpp" -#include "mysql/metadata.hpp" -#include "mysql/impl/container_equals.hpp" +#include "boost/mysql/detail/basic_types.hpp" +#include "boost/mysql/value.hpp" +#include "boost/mysql/metadata.hpp" +#include "boost/mysql/detail/aux/container_equals.hpp" #include namespace mysql diff --git a/include/mysql/value.hpp b/include/boost/mysql/value.hpp similarity index 98% rename from include/mysql/value.hpp rename to include/boost/mysql/value.hpp index c632dadc..f50c3f86 100644 --- a/include/mysql/value.hpp +++ b/include/boost/mysql/value.hpp @@ -69,7 +69,7 @@ std::array make_values(Types&&... args); } -#include "mysql/impl/value.hpp" +#include "boost/mysql/impl/value.hpp" #endif diff --git a/include/mysql/impl/binary_deserialization.hpp b/include/mysql/impl/binary_deserialization.hpp deleted file mode 100644 index 333e380a..00000000 --- a/include/mysql/impl/binary_deserialization.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_HPP_ -#define INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_HPP_ - -#include "mysql/impl/serialization.hpp" -#include "mysql/error.hpp" -#include "mysql/value.hpp" -#include "mysql/metadata.hpp" -#include - -namespace mysql -{ -namespace detail -{ - -inline Error deserialize_binary_value( - DeserializationContext& ctx, - const field_metadata& meta, - value& output -); - -inline error_code deserialize_binary_row( - DeserializationContext& ctx, - const std::vector& meta, - std::vector& output -); - -} -} - -#include "mysql/impl/binary_deserialization.ipp" - -#endif /* INCLUDE_MYSQL_IMPL_BINARY_DESERIALIZATION_HPP_ */ diff --git a/include/mysql/impl/network_algorithms/common.hpp b/include/mysql/impl/network_algorithms/common.hpp deleted file mode 100644 index 032ea7cd..00000000 --- a/include/mysql/impl/network_algorithms/common.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_COMMON_HPP_ -#define INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_COMMON_HPP_ - -#include -#include -#include "mysql/error.hpp" -#include "mysql/metadata.hpp" -#include "mysql/impl/channel.hpp" -#include "mysql/impl/messages.hpp" - -namespace mysql -{ -namespace detail -{ - -using deserialize_row_fn = error_code (*)( - DeserializationContext&, - const std::vector&, - std::vector& -); - -} -} - - - -#endif /* INCLUDE_MYSQL_IMPL_NETWORK_ALGORITHMS_COMMON_HPP_ */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3417d586..3b451511 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,21 +16,21 @@ endif() # of the runtime penalty (specially considerable in integration tests) add_executable( mysql_unittests - unit/serialization.cpp - unit/capabilities.cpp - unit/auth.cpp + unit/detail/auth/mysql_native_password.cpp + unit/detail/protocol/serialization.cpp + unit/detail/protocol/capabilities.cpp + unit/detail/protocol/text_deserialization.cpp + unit/detail/protocol/binary_deserialization.cpp + unit/detail/protocol/null_bitmap_traits.cpp unit/metadata.cpp - unit/text_deserialization.cpp - unit/binary_deserialization.cpp unit/value.cpp unit/row.cpp unit/error.cpp - unit/null_bitmap.cpp unit/prepared_statement.cpp ) # A codegen issue in MSVC C++17 makes gmock expectations not work if (NOT MSVC) - target_sources(mysql_unittests PRIVATE unit/channel.cpp) + target_sources(mysql_unittests PRIVATE unit/detail/protocol/channel.cpp) endif() target_include_directories( diff --git a/test/unit/serialization_test_common.hpp b/test/common/serialization_test_common.hpp similarity index 97% rename from test/unit/serialization_test_common.hpp rename to test/common/serialization_test_common.hpp index 83f48144..238379bf 100644 --- a/test/unit/serialization_test_common.hpp +++ b/test/common/serialization_test_common.hpp @@ -1,14 +1,14 @@ #ifndef TEST_SERIALIZATION_TEST_COMMON_HPP_ #define TEST_SERIALIZATION_TEST_COMMON_HPP_ -#include "mysql/impl/messages.hpp" -#include "mysql/impl/constants.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/protocol/constants.hpp" #include #include #include #include -#include "mysql/impl/serialization.hpp" -#include "mysql/value.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" +#include "boost/mysql/value.hpp" #include "test_common.hpp" namespace mysql diff --git a/test/common/test_common.hpp b/test/common/test_common.hpp index 9bbd8325..67460640 100644 --- a/test/common/test_common.hpp +++ b/test/common/test_common.hpp @@ -1,8 +1,8 @@ #ifndef TEST_TEST_COMMON_HPP_ #define TEST_TEST_COMMON_HPP_ -#include "mysql/value.hpp" -#include "mysql/row.hpp" +#include "boost/mysql/value.hpp" +#include "boost/mysql/row.hpp" #include #include #include diff --git a/test/integration/handshake.cpp b/test/integration/handshake.cpp index b14d4459..4057ed0e 100644 --- a/test/integration/handshake.cpp +++ b/test/integration/handshake.cpp @@ -5,7 +5,7 @@ * Author: ruben */ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include "integration_test_common.hpp" #include "test_common.hpp" #include diff --git a/test/integration/integration_test_common.hpp b/test/integration/integration_test_common.hpp index 554ae319..61db8486 100644 --- a/test/integration/integration_test_common.hpp +++ b/test/integration/integration_test_common.hpp @@ -2,7 +2,7 @@ #define TEST_INTEGRATION_INTEGRATION_TEST_COMMON_HPP_ #include -#include +#include "boost/mysql/connection.hpp" #include #include #include diff --git a/test/integration/metadata_validator.hpp b/test/integration/metadata_validator.hpp index cd2b734e..a862860f 100644 --- a/test/integration/metadata_validator.hpp +++ b/test/integration/metadata_validator.hpp @@ -1,7 +1,7 @@ #ifndef TEST_INTEGRATION_METADATA_VALIDATOR_HPP_ #define TEST_INTEGRATION_METADATA_VALIDATOR_HPP_ -#include "mysql/metadata.hpp" +#include "boost/mysql/metadata.hpp" #include namespace mysql diff --git a/test/integration/network_functions.hpp b/test/integration/network_functions.hpp index 66e02b40..9fbde5ce 100644 --- a/test/integration/network_functions.hpp +++ b/test/integration/network_functions.hpp @@ -1,7 +1,7 @@ #ifndef TEST_INTEGRATION_NETWORK_FUNCTIONS_HPP_ #define TEST_INTEGRATION_NETWORK_FUNCTIONS_HPP_ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include "test_common.hpp" #include #include diff --git a/test/integration/query.cpp b/test/integration/query.cpp index 3ce49735..79d969e8 100644 --- a/test/integration/query.cpp +++ b/test/integration/query.cpp @@ -5,7 +5,7 @@ * Author: ruben */ -#include "mysql/connection.hpp" +#include "boost/mysql/connection.hpp" #include // for EXPECT_THAT() #include #include "metadata_validator.hpp" diff --git a/test/unit/auth.cpp b/test/unit/detail/auth/mysql_native_password.cpp similarity index 90% rename from test/unit/auth.cpp rename to test/unit/detail/auth/mysql_native_password.cpp index fc776b5d..04fbf709 100644 --- a/test/unit/auth.cpp +++ b/test/unit/detail/auth/mysql_native_password.cpp @@ -5,13 +5,16 @@ * Author: ruben */ -#include "mysql/impl/auth.hpp" +#include "boost/mysql/detail/auth/mysql_native_password.hpp" #include #include using namespace mysql::detail; using namespace testing; +namespace +{ + TEST(MysqlNativePassword, ComputeAuthString_NonEmptyPassword_ReturnsExpectedHash) { // Values snooped using Wireshark @@ -30,3 +33,5 @@ TEST(MysqlNativePassword, ComputeAuthString_NonEmptyPassword_ReturnsExpectedHash mysql_native_password::compute_auth_string(password, challenge.data(), actual.data()); EXPECT_EQ(expected, actual); } + +} // anon namespace diff --git a/test/unit/binary_deserialization.cpp b/test/unit/detail/protocol/binary_deserialization.cpp similarity index 99% rename from test/unit/binary_deserialization.cpp rename to test/unit/detail/protocol/binary_deserialization.cpp index 40205994..c5816810 100644 --- a/test/unit/binary_deserialization.cpp +++ b/test/unit/detail/protocol/binary_deserialization.cpp @@ -6,7 +6,7 @@ */ #include -#include "mysql/impl/binary_deserialization.hpp" +#include "boost/mysql/detail/protocol/binary_deserialization.hpp" #include "test_common.hpp" using namespace mysql::detail; diff --git a/test/unit/capabilities.cpp b/test/unit/detail/protocol/capabilities.cpp similarity index 96% rename from test/unit/capabilities.cpp rename to test/unit/detail/protocol/capabilities.cpp index bcd48428..95b7fcc1 100644 --- a/test/unit/capabilities.cpp +++ b/test/unit/detail/protocol/capabilities.cpp @@ -5,7 +5,7 @@ * Author: ruben */ -#include "mysql/impl/capabilities.hpp" +#include "boost/mysql/detail/protocol/capabilities.hpp" #include using namespace mysql::detail; diff --git a/test/unit/channel.cpp b/test/unit/detail/protocol/channel.cpp similarity index 99% rename from test/unit/channel.cpp rename to test/unit/detail/protocol/channel.cpp index 3d4cf2d4..4ca5f48b 100644 --- a/test/unit/channel.cpp +++ b/test/unit/detail/protocol/channel.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "mysql/impl/channel.hpp" +#include "boost/mysql/detail/protocol/channel.hpp" using namespace testing; using namespace mysql::detail; diff --git a/test/unit/null_bitmap.cpp b/test/unit/detail/protocol/null_bitmap_traits.cpp similarity index 99% rename from test/unit/null_bitmap.cpp rename to test/unit/detail/protocol/null_bitmap_traits.cpp index 1d193acc..14f59de1 100644 --- a/test/unit/null_bitmap.cpp +++ b/test/unit/detail/protocol/null_bitmap_traits.cpp @@ -1,7 +1,7 @@ #include #include -#include "mysql/impl/null_bitmap_traits.hpp" +#include "boost/mysql/detail/protocol/null_bitmap_traits.hpp" #include "test_common.hpp" using mysql::detail::null_bitmap_traits; diff --git a/test/unit/serialization.cpp b/test/unit/detail/protocol/serialization.cpp similarity index 99% rename from test/unit/serialization.cpp rename to test/unit/detail/protocol/serialization.cpp index b924df41..004e3499 100644 --- a/test/unit/serialization.cpp +++ b/test/unit/detail/protocol/serialization.cpp @@ -6,8 +6,8 @@ */ #include "serialization_test_common.hpp" -#include "mysql/impl/messages.hpp" -#include "mysql/impl/binary_serialization.hpp" +#include "boost/mysql/detail/protocol/messages.hpp" +#include "boost/mysql/detail/protocol/binary_serialization.hpp" #include "test_common.hpp" #include #include diff --git a/test/unit/text_deserialization.cpp b/test/unit/detail/protocol/text_deserialization.cpp similarity index 99% rename from test/unit/text_deserialization.cpp rename to test/unit/detail/protocol/text_deserialization.cpp index 3dc5742d..a5318ef3 100644 --- a/test/unit/text_deserialization.cpp +++ b/test/unit/detail/protocol/text_deserialization.cpp @@ -6,7 +6,7 @@ */ #include -#include "mysql/impl/text_deserialization.hpp" +#include "boost/mysql/detail/protocol/text_deserialization.hpp" #include "test_common.hpp" using namespace mysql::detail; diff --git a/test/unit/error.cpp b/test/unit/error.cpp index 1e5cac8e..ae141bcc 100644 --- a/test/unit/error.cpp +++ b/test/unit/error.cpp @@ -6,7 +6,7 @@ */ #include -#include "mysql/error.hpp" +#include "boost/mysql/error.hpp" using namespace testing; using mysql::Error; diff --git a/test/unit/metadata.cpp b/test/unit/metadata.cpp index 18e0d5a0..d65320f5 100644 --- a/test/unit/metadata.cpp +++ b/test/unit/metadata.cpp @@ -5,9 +5,9 @@ * Author: ruben */ -#include "mysql/metadata.hpp" +#include "boost/mysql/metadata.hpp" #include -#include "mysql/impl/serialization.hpp" +#include "boost/mysql/detail/protocol/serialization.hpp" using namespace testing; using namespace mysql::detail; diff --git a/test/unit/prepared_statement.cpp b/test/unit/prepared_statement.cpp index 317a3e1d..f96763d2 100644 --- a/test/unit/prepared_statement.cpp +++ b/test/unit/prepared_statement.cpp @@ -6,7 +6,7 @@ */ #include "test_common.hpp" -#include "mysql/prepared_statement.hpp" +#include "boost/mysql/prepared_statement.hpp" #include using namespace mysql::detail; diff --git a/test/unit/row.cpp b/test/unit/row.cpp index 11e36d8e..df80ff6b 100644 --- a/test/unit/row.cpp +++ b/test/unit/row.cpp @@ -6,7 +6,7 @@ */ #include -#include "mysql/row.hpp" +#include "boost/mysql/row.hpp" #include "test_common.hpp" using namespace mysql::test; diff --git a/test/unit/value.cpp b/test/unit/value.cpp index 6bf974b8..6a9b7037 100644 --- a/test/unit/value.cpp +++ b/test/unit/value.cpp @@ -7,7 +7,7 @@ #include #include -#include "mysql/value.hpp" +#include "boost/mysql/value.hpp" #include "test_common.hpp" using namespace mysql::test;