diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-08-03 13:40:17 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-08-04 14:40:44 +0200 |
commit | ea96e408fe794a2e218e4f263cb3d4209bbb9b4a (patch) | |
tree | e4854f4fbc00ff70464bcdc00fb78cf9a1249ede /src/server/shared/Packets/ByteBuffer.h | |
parent | c54328eeba796cc887926e7332831f5ff82701a1 (diff) |
Core/PacketIO: Use std::string_view to read strings from ByteBuffer
(cherry picked from commit d72e91bee27f766c1f7e50640473522a07fc5389)
Diffstat (limited to 'src/server/shared/Packets/ByteBuffer.h')
-rw-r--r-- | src/server/shared/Packets/ByteBuffer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 7de0dde99e7..9233c4f5150 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -49,7 +49,7 @@ public: class TC_SHARED_API ByteBufferInvalidValueException : public ByteBufferException { public: - ByteBufferInvalidValueException(char const* type, char const* value); + ByteBufferInvalidValueException(char const* type, std::string_view value); }; class TC_SHARED_API ByteBuffer @@ -509,9 +509,9 @@ class TC_SHARED_API ByteBuffer append(str, len); } - std::string ReadCString(bool requireValidUtf8 = true); + std::string_view ReadCString(bool requireValidUtf8 = true); - std::string ReadString(uint32 length, bool requireValidUtf8 = true); + std::string_view ReadString(uint32 length, bool requireValidUtf8 = true); uint8* contents() { |