Commit Graph

155 Commits (master)

Author SHA1 Message Date
Peter Nelson 440a633fcc Codechange: Remove shrink_to_fit for more lists.
A comment about "will actually do nothing" is out of date as that is not the case with std::vector.

These lists are always short lived (either within a command handler or in a window) so don't shrink_to_fit.
2 months ago
Peter Nelson d57bf84196
Codechange: Remove some unnecessary c_str() when passing std::strings. (#12532)
Functions have been updated from `char *` to `std::string` since without removing `c_str()`.
2 months ago
Peter Nelson 42523379d9 Codechange: Use directory_iterator in ScanPath.
Replaces use of custom ttd_opendir.
2 months ago
Peter Nelson d7c547d0db Codechange: Use directory_iterator to list directories in file list windows.
This replaces use of custom ttd_opendir. Files are listed separately using ScanPath as that handles downloaded content.
2 months ago
Peter Nelson a1b03ee69e
Codechange: Replace platform-specific calls with std::filesystem::last_write_time. (#12487) 2 months ago
Peter Nelson 4eaeccdaeb
Codechange: Introduce FioRemove() to remove files. (#12491)
New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
2 months ago
Patric Stout a1487ce620
Add: list_[scenario|heightmap] and load_[scenario|height] console commands (#11867) 5 months ago
Patric Stout 090616b4c9
Add: allow loading heightmaps from command-line (#11870)
If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
5 months ago
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 5 months ago
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 8 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months 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
11 months ago
Rubidium af9b9327af Codechange: do not keep local variable for temporary string parameters 12 months ago
Owen Rudge 1a3d1bca59 Remove: OS/2 port 1 year ago
Rubidium fbd71a9d72 Codechange: replace C-style string processing with C++-style for the listing callbacks 1 year ago
Rubidium 324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 1 year ago
Rubidium f2e704b9a7 Codechange: use std::string for FiosIsRoot 1 year ago
Rubidium 13789d1703 Codechange: use std::string for FiosIsValidFile 1 year ago
Rubidium d9a04ba446 Codechange: make the MD5 hash/digest/checksum variables a std::array 1 year ago
Rubidium 98972a0748 Codechange: use C++ strings for constructing script file paths 1 year ago
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
1 year ago
Rubidium 397221b94a Codechange: Make ScenarioIdentifier use std::string for the filename 1 year ago
Rubidium 3a822fcd01 Codechange: Make FiosItem's name and title std::string 1 year ago
Rubidium f0a1ddd81c Codechange: let FiosBrowseTo return a bool 1 year ago
Rubidium c829930440 Codechange: replace strnatcmp with C++ string capable version 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
Charles Pigott 80bd5ad727
Codechange: Use std::strto* variants everywhere (#10720) 1 year ago
Rubidium ae422be979 Cleanup: remove/replace trailing ; with . in comments 1 year ago
Loïc Guilloux 460991ecf4
Feature: Persistant rotation of numbered auto/netsave after restart (#9397)
It was always starting from 0 on openttd restart.
Now the most recent auto/netsave number will be used as a base to generate the next filename.
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 6bca9e090d Codechange: add SetDParamStr that accepts std::string& 3 years ago
glx22 983c7ade60 Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops 3 years ago
PeterN f018471b36
Cleanup: Remove old FiosList helper methods. (#9139) 3 years ago
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 3 years ago
glx22 45e8b7a5bd Add: Allow translation of "(Directory)" and "(Parent directory)" 3 years ago
Michael Lutz 4f8e7b2a2b
Fix 65f65ad2: Missing path separator that fell over a cliff. 4 years ago
Michael Lutz b408fe77f7 Codechange: Use std::string in file scanners. 4 years ago
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 4 years ago
Michael Lutz f3326d34e7 Codechange: Use std::string in FIO search path handling. 4 years ago
Quipyowert2 acb3d10832 Codechange: Format unsigned integers with %u instead of %i or %d. 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Juriy Petrochenkov 8c6a16ba28 Fix: Possible double path separator in FiosMakeFilename 5 years ago
Owen Rudge 165eae0e80 Fix: Avoid using stat to retrieve file modification times on Windows (#7731) 5 years ago
Juriy Petrochenkov 7bdde8b41d Fix: Use natural sort when sorting the file list. 5 years ago
glx22 66a8db9dc5
Fix #7526, 5b77102b6: FiosItem::operator< must return false for equality (#7528) 5 years ago
glx 5b77102b63 Codechange: use std::sort() to sort file lists 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago