Commit Graph

109 Commits (9a7750f14eccd8afb6e8bb608ec421c09a486d53)

Author SHA1 Message Date
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 5 years ago
Michael Lutz fbc4cef180 Codechange: Use override specifier for text layout classes. 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 5 years ago
Patric Stout 36105841b9 Codechange: ICU_SORT is in reality ICU_I18N (according to their CMake files)
By naming it in a different way, things get a bit confusing.
Especially if we are switching to CMake, which autodetects these
things, we need to use the name the authors of ICU gave it; not
our interpertation of that name.
5 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
Michael Lutz 4bf216993a Add: [OSX] Native text caret handling. 6 years ago
Michael Lutz 8d7cd6a526 Add: [OSX] Native natural sort implementation. 6 years ago
Charles Pigott 52ed3bcbaa Remove: A few bits of dead code 6 years ago
Charles Pigott e0c0394e37 Fix: Remove various dead or unnecessary assignments 6 years ago
Michael Lutz eec3f40931 Change: [Win32] Use Uniscribe instead of ICU for text caret handling.
This removes the need for the ICU lib on Windows.
6 years ago
Michael Lutz f4394debdc Add: [Win32] Native natural sort implementation. 6 years ago
michi_cc 35b77450f8 (svn r27380) -Fix: [Win32] Compilation with MSVC2015. 9 years ago
rubidium 562c269770 (svn r27377) -Codechange: use the pkg-config files of ICU as well. Since they are split into separate libraries it becomes possible to split RTL support for natural sorting, although the effect will be minimal 9 years ago
rubidium 69fac508c3 (svn r27367) -Codechange: make a distinction between the layouting part of ICU (lx) or the sorting/collation part of ICU (i18n) 9 years ago
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
rubidium db8d208bfc (svn r26507) -Cleanup: remove now unused custom strndup implementation 10 years ago
rubidium e61fe21237 (svn r26506) -Codechange: replace most of vsnprintf with vseprintf 10 years ago
rubidium 99452c51ce (svn r26500) -Cleanup: remove unused snprintf implementation 10 years ago
rubidium 382ca0941f (svn r26498) -Add: method for duplicating strings with similar behaviours as strecpy and strecat; give end pointer instead of a size 10 years ago
frosch ef4c2ce031 (svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat. 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium ddc35bc252 (svn r26472) -Cleanup: pointless instance variable 10 years ago
fonsinchen d0aa98ef7d (svn r26384) -Fix [FS#5924]: Return correct values from ICU iterators in case of leading or trailing whitespace 10 years ago
rubidium 5e3aa72855 (svn r26124) -Fix: make sure all members of the default string iterator are initialised 11 years ago
rubidium cdd6752ead (svn r25952) -Fix [FS#5719]: do not skip numbers when skipping spaces and other sorting 'improving' characters 11 years ago
michi_cc 76367f6bf1 (svn r25653) -Add: Caret movement by words for CJK languages. 11 years ago
michi_cc e7dc14b25a (svn r25652) -Fix: Improve text caret movement for complex scripts. 11 years ago
rubidium 4c443bce5c (svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger 11 years ago
alberth 631540c400 (svn r25527) -Fix[FS#5621]: strndup should not examine strings beyond its upper limit. 11 years ago
rubidium 7c0f34130c (svn r25454) -Remove/Fix/Cleanup: SETX(Y) does not work at all with other than default fonts, so get rid of it 11 years ago
frosch 3e02890b73 (svn r24983) -Change: Apply the same name sorting rules to content and NewGRF list as for the server list. 12 years ago