Commit Graph

5 Commits

Author SHA1 Message Date
Andreas Kling
fdfda6dec2 AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:

- int StringType::to_int(bool& ok) const

And replace it with sensible new signature:

- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
Brendan Coles
edd8abc4cf LibCore: read_bool_entry parse "true" / "false" strings in config files
`read_bool_entry()` can now interpret both integers (1 or 0) and
Boolean strings ("true" or "false") in configuration files.

All values other than "1" or "true" are considered false.
2020-04-23 11:04:25 +02:00
Andreas Kling
c45e16f605 LibCore: Add StandardPaths thing to retrieve various standard locations
Fixes #1853.
2020-04-19 19:57:05 +02:00
Jesse Buhagiar
22cdf12ec4 LibCore: Allow ConfigFile::read_num_entry to handle negative numbers
Previously, this function was using `AK::String::to_uint()`, which is
wrong considering the function returns type `int`. This also means that
configuration files would revert to the default value on negative
values.
2020-02-26 11:48:53 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00