Commit Graph

64 Commits

Author SHA1 Message Date
Rubidium
89deb3876f Codechange: use fstream to compare file equality 2025-05-06 21:29:21 +02:00
Rubidium
4c1cd4fe4c Codefix: remove unused mem_func includes 2025-05-06 20:03:35 +02:00
Rubidium
85f1110569 Codechange: rewrite ini file parsing with the StringConsumer 2025-05-03 17:13:33 +02:00
Rubidium
fbe80f31fe Codechange: replace char* in GetOptData with std::string_view 2025-04-30 23:49:06 +02:00
Rubidium
af25eecc15 Codechange: use const for std::string_view where appropriate 2025-04-29 10:15:18 +02:00
Rubidium
be53bd320d Codechange: replace char* from settingsgen 2025-04-28 23:27:46 +02:00
Rubidium
9107c3f6c6 Codechange: add std::string_view variant of FileHandle::Open 2025-04-28 21:31:12 +02:00
frosch
dc21fae18e Codechange: Add InPlaceReplacement to couple StringConsumer and Builder on the same buffer. 2025-04-14 18:07:23 +02:00
frosch
800d6e339d Codechange: Add StringConsumer. 2025-04-13 21:59:10 +02:00
frosch
ad8e9634ec Codechange: Generalize StringBuilder. 2025-04-08 23:10:58 +02:00
frosch
b19e43ae99 Add: Utf8View and iterator. 2025-04-03 18:43:41 +02:00
Rubidium
02f040b22a Codechange: remove unused alloc_func.hpp includes 2025-02-24 20:00:19 +01:00
Jonathan G Rennison
23dc393822
Codechange: Compile fmt internals in a separate translation unit (#13527)
Instead of defining FMT_HEADER_ONLY to include fmt internals
in the headers included by all fmt-using translation units.
2025-02-11 20:11:50 +01:00
Peter Nelson
62da507aba
Codechange: Update minimum CMake version to 3.16 for all parts. (#13141)
The main CMakeList requires 3.16, so bump all other files to match.
2024-12-04 14:12:57 +00:00
Peter Nelson
3be0166801 Codechange: Use std::ranges::find where possible.
Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
2024-11-24 10:36:03 +00:00
Peter Nelson
908ee7292b
Codechange: Replace all FILE * with FileHandle RAII class. (#12718)
This removes the need to manually ensure all files are closed.
2024-09-16 08:45:26 +01:00
Peter Nelson
ca73f03334
Codechange: Use std::filesystem::remove/rename in settingsgen. (#12483) 2024-04-12 14:32:35 +01:00
Peter Nelson
44b8210037
Codechange: settingsgen's CopyFile actually appends. (#12485) 2024-04-12 13:01:16 +01:00
Rubidium
afd7878de0 Codechange: internally use a span of arguments for GetOptData 2024-04-11 12:00:36 +02:00
Rubidium
e8a56db21d Codechange: use designated initializers for OptionData and pass as span 2024-04-11 12:00:36 +02:00
frosch
b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Peter Nelson
69e20e79ab Codechange: Add const versions of GetItem/GetGroup, and sprinkle liberally.
Non-const version of GetItem is not needed.
2023-10-20 18:37:27 +01:00
Peter Nelson
17ba9d8c96 Codechange: Use range-for instead of nullptr-terminated list in settingsgen.
This simplifies iteration and avoids use of pointers.
2023-10-20 18:37:27 +01:00
Peter Nelson
233aac567b Codechange: Use std::list instead of C-linked list for ini files.
This removes self-management of memory with new/delete and allows simpler iteration.
2023-10-20 18:37:27 +01:00
Peter Nelson
8bd06807e4 Codechange: Pass initializer list instead of null-terminated list of group types. 2023-10-20 18:37:27 +01:00
Peter Nelson
1fecbeff76 Codechange: Remove create parameter from IniLoadFile::GetGroup.
GetGroup now only returns nullptr if the group does not exist.
Use GetOrCreateGroup to create a group.

This avoids creating groups while reading ini files.
2023-10-20 18:37:27 +01:00
Peter Nelson
0c85ce29ea Codechange: Pass ini file by reference and prefer automatic storage.
This avoids new/delete operations, and (not) checking for nullptr.
2023-10-20 18:37:27 +01:00
Peter Nelson
49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
frosch
b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
PeterN
64d6ad50f9
Codechange: Split GetItem with GetOrCreateItem. (#10952)
`IniGroup::GetItem()` returns nullptr if the item does not exist, but does not if the create parameter is set to true. Resolve CodeQL warnings with `GetOrCreateItem()` which returns a reference to the item instead.
2023-06-05 18:29:52 +00:00
Rubidium
2efd88d513 Cleanup: version of strgen/settingsgen was always $Revision$, so remove it 2023-05-21 19:39:09 +02:00
Rubidium
411379f587 Codechange: replace puts with fmt::print 2023-05-21 15:12:02 +02:00
Rubidium
275ebf4509 Codechange: replace fprintf(<FILE*> with fmt::print(<FILE*> 2023-05-21 15:12:02 +02:00
Rubidium
3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 2023-05-20 16:53:10 +02:00
PeterN
bda754ec83
Fix: Make all settingsgen 'warnings' fatal. (#10766)
Compilation should stop If settingsgen fails to complete properly.
2023-05-05 09:22:03 +01:00
Rubidium
f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
Patric Stout
74aa934441 Codechange: validate that "max" value of settings fit in their storage
This is an easy mistake to make, so protect us against making such
mistakes, by validating it doesn't happen.
2021-03-01 23:17:47 +01:00
glx22
2cbfcd2327 Change: [CMake] Bump minimum version to 3.9 2021-02-07 16:21:13 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Michael Lutz
358056ec42 Codechange: Keep filenames of loaded Fio files in std::strings. 2020-12-27 13:19:25 +01:00
Michael Lutz
79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
glx22
a06fe8e8a7 Fix: [CMake] cross-compiling requires native tools 2020-12-04 09:49:31 +00:00
Patric Stout
56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
Michael Lutz
715aa67a9c Codechange: Use std::string in INI file parsing. 2020-05-21 20:02:34 +02:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
glx22
acb09eb9a8 Fix: [Win64] settingsgen MSVC compile warnings (#7432) 2019-03-28 21:25:21 +01:00
Henry Wilson
c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson
ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00