Max Kellermann
b63a794fbe
io/FileDescriptor: add [[nodiscard]]
2024-01-13 22:31:16 +01:00
Rosen Penev
7c520f6475
fs: fix typo
...
Wrong macro used.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-12-26 10:57:44 -08:00
Max Kellermann
08a5768764
fs/io/TextFile: split into class FileLineReader and AutoGunzipFileLineReader
...
Detangle dependencies.
2023-11-25 22:50:32 +01:00
Max Kellermann
34182990ef
fs/FileInfo: add fstat() wrapper
2023-10-07 12:49:07 +02:00
Max Kellermann
7b5f107341
fs/FileInfo: add GetFileInformationByHandleEx() wrapper
2023-10-07 12:37:49 +02:00
Max Kellermann
e9ec03f769
PlaylistFile: use uint_least64_t
2023-10-07 12:29:14 +02:00
Max Kellermann
579a6ee299
fs/FileInfo: un-inline the constructor to reduce header dependencies
2023-10-07 12:28:31 +02:00
Max Kellermann
f549c611ab
fs/FileInfo: make constructor explicit
2023-10-07 12:24:05 +02:00
Max Kellermann
51c0a03e94
fs/FileInfo: add constexpr
and noexcept
2023-10-07 12:22:54 +02:00
Max Kellermann
20bbe1b57b
fs/Traits: add GetFilenameSuffix() overload with std::string_view
2023-09-06 14:50:36 +02:00
Max Kellermann
dbfd0a833d
io/meson.build: move sources to libio_fs.a
...
Only that one has a dependency on libfs.a (for class AllocatedPath
etc.).
2023-03-07 12:48:47 +01:00
Max Kellermann
0c102a8f2f
meson.build: add missing libfmt dependencies
2023-03-06 20:10:06 +01:00
Max Kellermann
2c66d90626
fs/io: move to separate library
...
To eliminate the libio.a dependency.
2023-03-06 19:47:29 +01:00
Max Kellermann
e4cdf29951
fs/meson.build: make several dependencies internal
2023-03-06 19:44:34 +01:00
Max Kellermann
b5d224ce22
fs/{StandardDirectory,CheckFile}: move to fs/glue/
...
Distangle library dependencies.
2023-03-06 19:43:09 +01:00
Max Kellermann
c937a299f7
fs/Charset: assign fs_charset
...
This got lost 8 years ago in commit 87c88fcb27
D'oh!
2023-03-06 19:25:44 +01:00
Max Kellermann
6d4ec8b46f
fs/Charset: remove useless log message
2023-03-06 19:20:22 +01:00
Max Kellermann
42f6a0441c
use [[gnu::...]] attributes
2023-03-06 16:14:15 +01:00
Max Kellermann
148aca23be
use SPDX IDs, replacing the long copyright headers
2023-03-06 14:59:48 +01:00
Max Kellermann
b1422fbda4
release v0.23.12
...
-----BEGIN PGP SIGNATURE-----
iQJBBAABCgArFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmPG4OcNHG1heEBibGFy
Zy5kZQAKCRAjbopYxttFElGQD/4lXFixr2fJuAWFYyFT4ebr2w7sPyhXwjlt5uCL
HTaMxTgQbhMmkHbGEO96UbF7gROGfq+dyvYTEmjWcVPTr/US3M8/mjT9T/DCLj6+
kF7rZM5ft6npqVxqikg/TQcUgoiSsgfI7dEK/vcXELPyx78bCaq0M0sd2GZvwiiM
vK9cxxDJ/RkF2dtfXRfGTJlihgQxaiuBZx8Bi3wJjbjvi/Lg85cu3iot9zFy5iDN
gNzC39dnPYv261lAT/LLNpzLYQzIFE5ul+8ucRNPo+mMS/odSPRdL9XYFDtarsqP
3Va83DChg7S6/GWfDeW81mQYPDuZ+1rPqbV5zEGimPsDWP9RugzPpZiFJlZrh8w7
MJp66RYxUWQpracRZIW4zMRiSzGSI3OXbvhx6qBmsn1CuQ19TkovWuRleD4lpfFv
dFzKHrdatJivM3xvq6CSg8ws+Q6f/j5sw1gzfvOofPlpybtvIrCvlvw78sKLW5n1
Ecwc+xN38bIVL3E2Ae6zeYQwArpB4+gKT3Wb+r3bjXz7YQYpETI3IbX0vixbl8pP
9O4ZKot/khOCaQBiZ5hHmiDmF5kxofLnJE4qgGX/c87ZaMUsu7hoKzksy9v7Z9wj
PNTshhWk1WrSwM1JnVjD5Ahz+Oe43UsKsGZ8Kturbuu+61uTX4QcmYpbaNilGnwk
J0cLyw==
=MW7q
-----END PGP SIGNATURE-----
Merge tag 'v0.23.12'
release v0.23.12
2023-01-17 18:58:04 +01:00
Max Kellermann
3cacb56bb7
fs/StandardDirectory: don't fall back to getpwuid() without $HOME
...
If the environment variable $HOME does not exist, don't attempt to
obtain it from /etc/passwd; without $HOME, the calling process
indicates that it does not wish MPD to access the home directory.
This also prevents MPD from attempting to load
`/root/.config/mpd/mpd.conf` if MPD got started as global systemd
service. Reading from there makes no sense, only /etc/mpd.conf shall
be used then.
This piece of code was initially added by commit 5d85792178
.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1687
2023-01-17 18:51:49 +01:00
Max Kellermann
66029c405f
system/FmtError: move to lib/fmt/
2022-11-28 23:09:27 +01:00
Max Kellermann
96ae659fdf
system/FmtError: new library
...
Replaces the Format*() functions in system/Error.hxx.
2022-11-28 21:56:12 +01:00
Max Kellermann
124e75c286
thread/Thread, fs: add missing WIN32 includes
2022-11-28 21:56:11 +01:00
Max Kellermann
3103e8d719
fs/StandardDirectory: update #ifdef for GetEnvPath()
...
Fixes regression from a38eabc8bc
2022-11-28 20:17:16 +01:00
Max Kellermann
cfbd751742
fs/StandardDirectory: pass Path to IsValidDir()
2022-11-28 18:48:10 +01:00
Max Kellermann
a38eabc8bc
fs/StandardDirectory: move code to GetExistingEnvDirectory()
2022-11-28 18:43:45 +01:00
Max Kellermann
9669ea6a12
fs/StandardDirectory: add noexcept
2022-11-28 18:27:06 +01:00
Max Kellermann
863a28daa3
fs/StandardDirectory: eliminate global variable "home_prefix"
2022-11-28 18:27:06 +01:00
Max Kellermann
ea5bcfed8b
fs/StandardDirectory: pass std::string_view to ParseConfigLine()
2022-11-28 17:11:17 +01:00
Max Kellermann
f6f3c4c25b
fs/StandardDirectory: pass const string to ParseConfigLine()
2022-11-28 17:07:29 +01:00
Max Kellermann
8fe29f5728
release v0.23.11
...
-----BEGIN PGP SIGNATURE-----
iQJBBAABCgArFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmOE2gINHG1heEBibGFy
Zy5kZQAKCRAjbopYxttFEiugD/9OKEBR9tfrJvtVGuO2INtaMeAzlZ9swFYCkphF
i2R7H9/9E0AvtgyFi/6EDNgFCBbnUzSIGbtdc78EwHE6GxeK/Q9G1fo9AC+6I8Ww
2ScEV9NKIMGTbsRvoomKnGZWpvNTpadPlLa02bckXpKK3wQUPhLb8RAH3newZ0RC
OXs+mzSRReRKpjUBxZsI+6f+aajM6/PoiOmBbrNbYbsSlkpKtLeW8ptkQxPME12B
QD9e7yf9ZndYfoHJdmmPxfvIGIEDATCs8MzY8tFUYkhdbEk0C0aRZQTODQS3DATp
0wrmlJzmceiN2nhKjthg1bvC+jobPywIuDZdrEuyFumN/EZxldKAUCezduV+Dohm
UPkQp5yiSTZRZVYQMEOSW6cMndC7URFrtn643+jV7SGkTmmV6nVOyg4e9GR1BakT
rY0nZGr7dwEInODkA5lXMhph3u8aZa2Mfo5B8m2aloGVHYOX1t3bH07ym5oJiviq
eiQx/bMpaS6ECCSnmHPGDl0NHHWDiPGv96EyPO2N9oeWiNuZz/Fla0N99Mi/JbVI
EpSHF89F+bfiw5qIeet93ZrXjwQjMuC6zofZ1jbVFek2eKszCZSNdx233VLz170G
edyN5Vxy3r24YBy/nrZVXPRxsj65KOxF1TZ9SzHKmfnuU45a+JZjZuWz5yedPn2/
3fy7oA==
=eLEd
-----END PGP SIGNATURE-----
Merge tag 'v0.23.11'
release v0.23.11
2022-11-28 17:00:38 +01:00
Max Kellermann
06514aec63
fs/StandardDirectory: add GetAppCacheDir()
2022-11-28 14:19:30 +01:00
Max Kellermann
4ded1ae67b
fs/FileSystem: add CreateDirectoryNoThrow()
2022-11-28 14:19:08 +01:00
Max Kellermann
1da974e3fa
fs/StandardDirectory: use PACKAGE_NAME from version.h
2022-11-28 14:05:34 +01:00
Max Kellermann
94f06f0946
fs/StandardDirectory: use mode=0777 in mkdir() call
...
Of course, mode=0700 is more secure, but allowing other users access
to new directories is a choice the user should make via umask(). If
the user-chosen umask allows everybody access, MPD should probably
respect that.
2022-11-28 14:04:47 +01:00
Max Kellermann
d9eec8a455
fs/StandardDirectory: do not use $RUNTIME_DIRECTORY on Android
...
This is systemd specific, and Android doesn't have systemd.
2022-11-28 10:44:50 +01:00
Max Kellermann
4f041694d3
release v0.23.9
...
-----BEGIN PGP SIGNATURE-----
iQJBBAABCgArFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmL+ZuYNHG1heEBibGFy
Zy5kZQAKCRAjbopYxttFEmxjD/4sJEq9DroRRK2qnVL1c6rwdzAL05LQwXGfWMCY
/eIfoYGgu+PPN65Xf/A7qEvsXXSpuDzq0jTzdmtSvQwfKgg5jy72Qn+LN0dmoSRn
mqQoqPFFxr7URf7QhL/6/EKcKYSexu/dxLnnuOC/yB/32WB+JINGNLWABrCpFMW0
4kbVSC6t/e07bfBxNoYKx+kSxX88n82v5LNjkPctx0oU0gRoyRZds273uuKHOIYQ
KFHHuaW9eNT0x/JrrsBD0ASXcp/9CfyVvyoag4bqJIc6Bg4fJTEZ9QPy9SUF2R8L
0QCG2DBqFoht7Xqyo7qe5vYy2lww/flVrH/UwB1V7xfWzbuv3qUYs2pRnFmPKjQx
23FRBkmC3tWmno+pZFaYmzprRKQK7WS9DJUzaQ8DCjNVpncadNPDRvz13BZjVLAE
LeAFxPZ3B3yrDIjNRGl9LEySMJs7M4jrqzXQZuWS3+O9IZV19ajGczWmFCyQOyu4
F7bj9tfy1yhUjMYOiUIxXsWvxZSVIo8wK1payCJzvKTobnUUeDfDucnD/lpVRMF8
HyJsaZrXwFIClBmK8nCh3LiB5Dh9nxl8xjtmrCiPVzGZvj5qnzMkZWF+C4wxblnZ
XTVmHFrpdcI3nK4BzLVrxF+3A08gPkIHta9boqrMhfX4gPWkKmD1vH/+u2OD2BIY
I2MASg==
=tk1U
-----END PGP SIGNATURE-----
Merge tag 'v0.23.9'
release v0.23.9
2022-08-18 18:23:12 +02:00
Max Kellermann
1f4df2a64d
android/Environment: pass JNIEnv to all functions
2022-08-18 18:09:54 +02:00
Max Kellermann
f883c09b6b
fs/FileSystem: add pure attributes
2022-08-18 16:53:32 +02:00
Max Kellermann
71acad6c21
fs/FileSystem: add noexcept
2022-08-18 16:53:31 +02:00
Max Kellermann
c344403bed
fs/Path: add operator+
2022-07-14 18:42:25 +02:00
Max Kellermann
fe3ab7b937
fs/Path: add WithSuffix()
2022-07-14 18:23:48 +02:00
Max Kellermann
458084d79b
fs/Path: add GetSuffix()
2022-07-14 18:20:55 +02:00
Max Kellermann
d3947d0ad5
fs/Path: GetExtension() skips all leading dots
...
Don't return an empty string for "..", because this path doesn't have
an extension.
2022-07-14 18:20:45 +02:00
Max Kellermann
849ed122c7
fs/Path: document GetExtension()
2022-07-14 18:12:00 +02:00
Max Kellermann
254ee00c37
fs/Path: rename GetSuffix() to GetExtension()
...
The "extension" is the name after the dot, but the "suffix" is the
string including the dot.
2022-07-14 18:12:00 +02:00
Max Kellermann
594b97feb1
fs/Path: change cast syntax
2022-07-14 18:12:00 +02:00
Max Kellermann
cc0def15c4
Copyright year 2022
2022-07-14 17:59:35 +02:00
Max Kellermann
4964eda167
fs/StandardDirectory: use std::string_view instead of StringView
2022-07-04 15:04:31 +02:00