Martchus
2e93882882
Reduce redundant code in stringconversion.h
2021-05-24 19:51:49 +02:00
Martchus
3afed30760
Detect overflow in functions to convert strings to numbers
...
Otherwise these functions can strictly run into undefined behavior which
should be prevented.
2021-05-24 19:51:49 +02:00
Martchus
d5e35e460c
Fix a few details in string conversion functions
2021-05-23 19:20:45 +02:00
Martchus
546b1fecb7
Fix parsing ISO timestamp with negative timezone offset and no seconds fraction
...
See https://github.com/Martchus/syncthingtray/issues/93
2021-05-21 19:40:37 +02:00
Martchus
63955ffcc5
Avoid including ranges header under reflective-rapidjson's generator
...
This works around errors which Clang 11.1.0 has when parsing this header
from GCC 11.1.0. (Yes, at this point the GCC and Clang versions which are
currently in Arch Linux testing are identical.)
2021-05-16 19:21:58 +02:00
Martchus
7cea979261
Remove obsolete comment about ios_base::failure and new ABI
2021-05-13 16:23:10 +02:00
Martchus
6d5045c2b1
Port away from deprecated WriteCompilerDetectionHeader module
2021-05-13 15:49:53 +02:00
Martchus
b22a600e77
Fix broken code in ArgumentParser::printBashCompletion() leading to crashes
...
See https://github.com/Martchus/cpp-utilities/issues/19#issuecomment-839758443
2021-05-12 17:52:36 +02:00
Martchus
f549285fde
Fix splitString()/splitStringSimple() for case of empty trailing part
2021-05-11 16:42:28 +02:00
Martchus
0fb533ffc5
Format attempted test file/dir lookups more nicely in the error case
2021-04-06 17:46:15 +02:00
Martchus
f30947cc75
Fix plural of parameter
2021-03-30 20:48:05 +02:00
Martchus
e2a7d807a3
Disable warnings about unused const variables
...
as these are usually just used in another compile unit
2021-03-22 13:45:16 +01:00
Martchus
b43de126b9
Retain source compatibility of numberToString()/stringToNumber()
...
IntegralType and BaseType need to be kept different types, otherwise one
runs into deduction errors if both arguments have different types (which is
quite likely in practise). Since the base is always a small positive
integer the cast should always be safe.
2021-03-22 13:45:16 +01:00
Martchus
a30ba0c147
Ensure still the right stringToNumber() overload is called for char arrays
2021-03-22 12:13:20 +01:00
Martchus
42132719e5
Remove comments about std::expected (which didn't even make it into C++20)
2021-03-22 12:12:11 +01:00
Martchus
9c532cbdd9
Ignore unknown warning options
2021-03-20 21:57:09 +01:00
Martchus
8c033ca243
Fix warnings
2021-03-20 21:56:45 +01:00
Martchus
d38a9bb776
Disable/weaken a few warnings again which don't seem to be very usefull after all
2021-03-20 20:58:28 +01:00
Martchus
f5aeeb77aa
Add CMake variable to enable defaults useful for development
2021-03-18 00:39:04 +01:00
Martchus
5b8520d50c
Add CMake variables to conveniently enable warnings and treat them as errors
2021-03-18 00:25:00 +01:00
Martchus
cd43879390
Remove uses of USES_TERMINAL without COMMAND again as it is not possible
2021-03-17 21:27:21 +01:00
Martchus
3c8eb5a333
Apply clang-format
2021-03-05 23:14:54 +01:00
Martchus
4fc415ed5a
Allow following test output live when building with ninja
2021-03-05 23:03:59 +01:00
Martchus
cc63c8c250
Improve parameter-passing in some string conversion functions
...
* Allow using a range as input of joinStrings()
* Use `std::string_view` instead of `const std::string &` to pass read-only
parameters to joinStrings() and splitString*() to avoid constructing an
`std::string` from `const char *` parameters
* Use auto for return types of toMultiline() and toArrayOfLines()
* Does not affect BC because those are template functions
* Should not affect source compatibility; at least uses in my main projects
seem to be unaffected
2021-03-05 23:01:30 +01:00
Martchus
6968716d5c
Avoid using substr in splitString()/splitStringSimple()
2021-02-23 20:54:04 +01:00
Martchus
27e9761f63
Adjust conditions for C++20 for g++
2021-02-09 00:22:20 +01:00
Martchus
c61a1784ec
Allow using splitStringSimple() with `std::unordered_set` in C++20
...
* So one could use e.g. `std::unordered_set<std::string_view>` as target
container when splitting an `std::string_view`.
* Still an experimental feature
2021-02-09 00:21:53 +01:00
Martchus
d1e3a28277
Apply cmake-format
2021-01-08 00:51:49 +01:00
Martchus
cabcc11d3e
Incorporate extra target suffix used when targeting MinGW in pkg-config file
2021-01-08 00:43:51 +01:00
Martchus
7fb2a9ed73
Avoid duplicating the `lib` prefix in the pkg-config file
...
This is in accordance with omitting the `lib` prefix of the target if the
project name already starts with `lib`.
2021-01-08 00:39:08 +01:00
Martchus
0be639ea97
Use `-lfoo` form in pkg-config file if dependency doesn't look like a path
...
So e.g. `-lpthread` is added to the pkg-config file instead of just
`pthread`.
2021-01-08 00:37:14 +01:00
Martchus
b1b0c10366
Prevent reading library properties from interface library targets
2021-01-07 20:06:12 +01:00
Martchus
566d1cc42a
Bump patch version
2021-01-07 19:43:51 +01:00
Martchus
9fb3bbe179
Export a target for using only headers of a library
...
Some backend libraries of Syncthing Tray and Reflective RapidJSON only use
certain headers of qtutilities/c++utilities. The current solution did not
really work because it did not distinguish between the build and install
interface and also did not take compile definitions and options into
account.
2021-01-01 18:42:22 +01:00
Martchus
27c8a17f99
Allow enforcing absence of a target suffix for Syncthing Tray's test helper
2021-01-01 18:38:09 +01:00
Martchus
47f7252bc0
Remove leftover message from debugging
2021-01-01 18:35:49 +01:00
Martchus
7ad2a9818d
Support target suffix when generating the dependency list for the config header
2021-01-01 18:34:43 +01:00
Martchus
a5d2aa15e0
Support Qt 6 modules when generating the dependency list for the config header
2021-01-01 18:32:27 +01:00
Martchus
f109d36ad2
Add Argument::firstValueOr() for conveniently accessing the first value with a fallback
2021-01-01 18:30:17 +01:00
Martchus
8a9d72bee9
Disable linking against default Qt plugins
...
This change would obviously better go into qtutilities. However, it is
easier done here and doesn't pull in any dependency on Qt anyways.
2020-12-20 17:53:37 +01:00
Martchus
293b18b607
Mark destructor of NativeFileStream as override
2020-12-18 21:09:35 +01:00
Martchus
80d2823915
Add PROJECT_CONFIG_SUFFIX to the config header
2020-12-14 20:57:05 +01:00
Martchus
9e940a7858
Add helper to modify a flag enum
2020-12-14 20:56:37 +01:00
Martchus
6905b1a216
Apply cmake-format
2020-11-25 18:02:24 +01:00
Martchus
70f827c78e
Apply clang-format
2020-11-25 17:53:28 +01:00
Martchus
28b924fe30
Document API/ABI stability
2020-11-25 17:53:14 +01:00
Martchus
ee96e03043
Mark formattedPhraseString() as experimental
2020-11-25 17:51:43 +01:00
Martchus
df126ab51c
Use std::size_t consistently
2020-11-25 17:51:13 +01:00
Martchus
c6095fbaf8
Add formattedPhraseString()
2020-11-18 00:37:43 +01:00
Martchus
a40ee3aa7e
Use query_qmake_variable_path if available
2020-11-11 18:51:50 +01:00