diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-01-03 13:04:19 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-01-03 13:04:19 +0100 |
| commit | 27860c3316b7354c6bf17cac82992085d2905934 (patch) | |
| tree | a0c87fdb392b2d3ce2af9e8788e1081421740975 /src/server/database/Database/PreparedStatement.h | |
| parent | 000e4e99702d703ada9b2798f579534b547e35a6 (diff) | |
Core/Database: Added std::span based functions to Field and PreparedStatement
Diffstat (limited to 'src/server/database/Database/PreparedStatement.h')
| -rw-r--r-- | src/server/database/Database/PreparedStatement.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/server/database/Database/PreparedStatement.h b/src/server/database/Database/PreparedStatement.h index 88151ef193b..d34eaa9d23f 100644 --- a/src/server/database/Database/PreparedStatement.h +++ b/src/server/database/Database/PreparedStatement.h @@ -21,7 +21,7 @@ #include "DatabaseEnvFwd.h" #include "Define.h" #include "Duration.h" -#include <array> +#include <span> #include <string> #include <variant> #include <vector> @@ -82,15 +82,10 @@ class TC_DATABASE_API PreparedStatementBase void setFloat(uint8 index, float value); void setDouble(uint8 index, double value); void setDate(uint8 index, SystemTimePoint value); - void setString(uint8 index, std::string const& value); - void setStringView(uint8 index, std::string_view value); - void setBinary(uint8 index, std::vector<uint8> const& value); - template <size_t Size> - void setBinary(const uint8 index, std::array<uint8, Size> const& value) - { - std::vector<uint8> vec(value.begin(), value.end()); - setBinary(index, vec); - } + void setString(uint8 index, std::string&& value); + void setString(uint8 index, std::string_view value); + void setBinary(uint8 index, std::vector<uint8>&& value); + void setBinary(uint8 index, std::span<uint8 const> value); uint32 GetIndex() const { return m_index; } std::vector<PreparedStatementData> const& GetParameters() const { return statement_data; } |
