MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SanitizeSingleStringHelper

Function SanitizeSingleStringHelper

src/script/api/script_object.hpp:357–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 /** Validate a single string argument coming from network. */
356 template <class T>
357 static inline void SanitizeSingleStringHelper(T &data)
358 {
359 if constexpr (std::is_same_v<std::string, T>) {
360 /* The string must be valid, i.e. not contain special codes. Since some
361 * can be made with GSText, make sure the control codes are removed. */
362 ::StrMakeValidInPlace(data, {});
363 }
364 }
365
366 /** Helper function to perform validation on command data strings. */
367 template <class Ttuple, size_t... Tindices>

Callers 1

SanitizeStringsHelperFunction · 0.70

Calls 1

StrMakeValidInPlaceFunction · 0.85

Tested by

no test coverage detected