Patric Stout
75f21065c9
Codechange: refactor DecodeHexText to a generic purpose ConvertHexToBytes ( #11866 )
...
DecodeHexText() does more than just decoding hex. ConvertHexToBytes()
now only does pure hex decoding. This required a bit of refactoring
for the code using DecodeHexText().
8 months ago
Rubidium
2d77cf9c80
Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with
9 months ago
Patric Stout
fd073a2810
Remove: replace custom span with std::span
9 months ago
Jonathan G Rennison
88324a253e
Fix #11644 : Off by one error/buffer over-read in StrMakeValid ( #11645 )
...
* Fix #11644 : Off by one error in StrMakeValid UTF-8 decode overrun detection
* Fix #11644 : Off by one error in StrMakeValid buffer last character
* Fix: Unnecessary string duplication at StrMakeValid call sites
9 months ago
Michael Lutz
86e28e79fb
Fix #11402 : Make string filter locale-aware.
11 months ago
Michael Lutz
c294eaacc1
Fix: char_traits::find needs to return nullptr if nothing was found.
11 months ago
Rubidium
37f84b7372
Codechange: replace x.size() != 0 with !x.empty()
12 months ago
Peter Nelson
49dae08a3b
Codechange: Add missing override specifiers.
1 year ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
Rubidium
b958a343fe
Codechange: the templated StrMakeValidInPlace is not in place
1 year ago
Rubidium
e04d43f396
Remove: now unused stredup
1 year ago
Rubidium
48dcb79145
Cleanup: remove seprintf and vsnprintf
1 year ago
Rubidium
97dd84d1e0
Codechange: move saveload string fixing code to saveload
1 year ago
Rubidium
e762855201
Cleanup: remove str_strip_colours; StrMakeValid also removes the colours
...
Essentially str_strip_colours followed by StrMakeValid makes the calling of
str_strip_colours useless, as StrMakeValid would have removed them too.
1 year ago
Rubidium
4ca23a19b6
Cleanup: char-pointer variant of strtolower
1 year ago
Rubidium
ce8933d63e
Add: std::back_insert_iterator<std::string> Utf8Encode function
1 year ago
Rubidium
6a519f5d89
Cleanup: strecat has no uses anymore
1 year ago
Rubidium
acec34a0fe
Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex
1 year ago
Rubidium
d9a04ba446
Codechange: make the MD5 hash/digest/checksum variables a std::array
1 year ago
Peter Nelson
83f2ad500e
Codechange: stdarg.h include not needed as cstdarg is included.
1 year ago
Patric Stout
febe394806
Codechange: replace C-style strings with C++-style strings in textfile ( #10772 )
1 year ago
Rubidium
a312a6c1b2
Codechange: make md5sumToString std::string compatible
1 year ago
Rubidium
ee9239d293
Fix c8299304: retain support ICU < 65
1 year ago
Rubidium
c829930440
Codechange: replace strnatcmp with C++ string capable version
1 year ago
Rubidium
b5f96808a1
Fix: FormatArrayAsHex returns gibberish instead of a hex array
1 year ago
Rubidium
4dd5f994be
Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith
1 year ago
Rubidium
86786a7af6
Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp
1 year ago
Rubidium
9fe853f7b5
Codechange: use fmt::format instead of vseprintf for midi command formatting
1 year ago
Rubidium
c8ff6a9f7c
Codechange: replace str_fmt with std::string constructs
1 year ago
Rubidium
f74e26ca7e
Codechange: replace error/usererror printf variant with fmt variant and rename
1 year ago
Rubidium
71b46db8d0
Cleanup: remove commented out code
2 years ago
Rubidium
b951332def
Codechange: use smart pointers when creating StringIterators
2 years ago
hallonsoda79
0d51460f27
Fix #10023 : Allow negative input in text fields when needed ( #10112 )
2 years ago
Michael Lutz
a05fd7aa50
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.
3 years ago
rubidium42
55a11710a6
Codechange: convert printf DEBUG statements to fmt Debug statements
3 years ago
rubidium42
fed3e3305f
Codechange: add function to determine whether are string starts or ends with a given other string
3 years ago
rubidium42
b4aedef848
Codechange: add std::string variant of Utf8StringLength
3 years ago
Patric Stout
7713c3e3cc
Codechange: move casting a "const char *" to "char *" to the caller
...
It is not nice to have your definition say you won't change a value
while in fact the whole reason for your existance is to change it.
3 years ago
Patric Stout
ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) ( #9304 )
...
This to be more explicit the function changes the value, and not
returns yes/no.
3 years ago
rubidium42
16437b7c0d
Codechange: move client name in settings to std::string
3 years ago
rubidium42
f00564eeb2
Fix: String validation could leave invalid Utf8 encoded strings ( #9096 )
...
In case a character was encoded in multiple bytes, but required fewer bytes to be encoded, the first byte would be copied to the output leaving an invalid Utf8 encoded string. Later uses of the validated string would use the same decode logic, which would yield a question mark and just read a single byte, so nothing dangerous happened.
Furthermore, because the next byte would not be a first byte of an encoded Utf8 character, the last few valid characters could be removed by the validation as well.
3 years ago
rubidium42
5202869f0f
Add: String functionality to trim spaces from C-style strings
3 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Michael Lutz
024a3f6259
Codechange: Use automatic memory management for language pack reading.
4 years ago
Michael Lutz
0c6e8a8123
Codechange: Store file search paths as std::string.
4 years ago
Marcus Calhoun-Lopez
eeed3a7613
Fix: unbreak building with ICU on macOS
...
A symbol clash breaks building ICU on macOS, and although it isn't
necessary, it might as well be possible.
4 years ago
Michael Lutz
715aa67a9c
Codechange: Use std::string in INI file parsing.
4 years ago
Michael Lutz
c082f570ce
Codechange: Use std::string when translating TTDP NewGRF string codes.
4 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
5 years ago
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
6 years ago