summaryrefslogtreecommitdiff
path: root/src/string_func.h
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-10-28 23:48:26 +0200
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commita05fd7aa50ecbee425df2d6f9015ec3ea359232f (patch)
tree9b9208d39813670789635b638592a903a2aafaa4 /src/string_func.h
parentb0990fcff7358e839468e5cf811ffddc8b9d73e2 (diff)
downloadopenttd-a05fd7aa50ecbee425df2d6f9015ec3ea359232f.tar.xz
Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command data to be different for every command type in the future.
Diffstat (limited to 'src/string_func.h')
-rw-r--r--src/string_func.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string_func.h b/src/string_func.h
index 0cbf26d6b..a5d3499c7 100644
--- a/src/string_func.h
+++ b/src/string_func.h
@@ -28,6 +28,7 @@
#include <iosfwd>
#include "core/bitmath_func.hpp"
+#include "core/span_type.hpp"
#include "string_type.h"
char *strecat(char *dst, const char *src, const char *last) NOACCESS(3);
@@ -39,6 +40,8 @@ int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap)
char *CDECL str_fmt(const char *str, ...) WARN_FORMAT(1, 2);
+std::string FormatArrayAsHex(span<const byte> data);
+
void StrMakeValidInPlace(char *str, const char *last, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK) NOACCESS(2);
[[nodiscard]] std::string StrMakeValid(const std::string &str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK);
void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK);