diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-01-03 13:04:19 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-03 18:05:04 +0100 |
commit | 5da556b9a4094da461a4c88249fb0359172d72d2 (patch) | |
tree | a18f013ee77e9f2bb9397c63d240cc4e49b12f6e /src/server/database/Database/PreparedStatement.h | |
parent | a7587de5ede4da43cdc87a98322e2002093985bf (diff) |
Core/Database: Added std::span based functions to Field and PreparedStatement
(cherry picked from commit 27860c3316b7354c6bf17cac82992085d2905934)
# Conflicts:
# src/server/game/Entities/Player/Player.cpp
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; } |