Commit Graph

369 Commits

Author SHA1 Message Date
Max Kellermann
ed327c597a lib/icu/Converter: Create() returns std::unique_ptr 2019-11-04 15:44:06 +01:00
Max Kellermann
1bfede120a fs/Traits: call std::string::reserve() in BuildPathImpl() 2019-09-04 12:01:25 +02:00
Max Kellermann
f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann
cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
Max Kellermann
d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann
a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann
bd6b7aa88e archive/Lookup: move to fs/LookupFile.cxx
This can be used for other purposes as well.
2019-06-15 14:26:26 +02:00
Max Kellermann
476647bfa0 fs/AllocatedPath: add GetSuffix() 2019-06-15 13:57:16 +02:00
Max Kellermann
3e3ee581a8 fs/Path: add constexpr 2019-05-31 19:47:50 +02:00
Max Kellermann
5641c4baa6 system/Clock, fs/FileInfo: move FILETIME specific code to time/FileTime.hxx 2019-05-08 16:02:13 +02:00
Max Kellermann
afdaaba045 fs/io/BufferedOutputStream: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann
1cfc0cb874 fs/io/AutoGunzipReader: use std::unique_ptr<> 2019-04-26 14:55:00 +02:00
Max Kellermann
3882c97545 fs/io/AutoGunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann
bf9f690c70 fs/io/GunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann
392b783c9e fs/io/TextFile: add noexcept 2019-04-26 14:44:27 +02:00
Max Kellermann
6d86902a02 fs/io/TextFile: use std::unique_ptr<> 2019-04-26 14:42:54 +02:00
Max Kellermann
1415bac1d6 fs/AllocatedPath: add Android-only FromUTF8(std::string&&) overload 2019-04-24 14:39:47 +02:00
Max Kellermann
7a98a784b2 fs/Features: add macro FS_CHARSET_ALWAYS_UTF8 2019-04-24 14:28:55 +02:00
Max Kellermann
162845cc6d fs/Charset: move HAVE_FS_CHARSET to Features.hxx 2019-04-24 14:24:54 +02:00
Max Kellermann
a8ee7269bc fs/Config: add noexcept 2019-04-24 14:24:21 +02:00
Max Kellermann
7c1843ee2e fs/AllocatedPath: add noexcept 2019-04-24 14:18:24 +02:00
Max Kellermann
bc8bb41aef fs/Path: add noexcept 2019-04-24 14:17:37 +02:00
Max Kellermann
a8b94a4507 fs/Traits: add noexcept 2019-04-24 14:16:45 +02:00
Max Kellermann
16906cdcbe fs/FileInfo: remove redundant inline keywords from constexpr functions 2019-03-12 11:54:31 +01:00
Max Kellermann
da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann
5b8ff61799 fs/io/BufferedOutputStream: add WithBufferedOutputStream() 2019-02-19 12:37:53 +01:00
Max Kellermann
cfe22502ab fs/io/StdioOutputStream: add noexcept 2019-01-22 09:03:49 +01:00
Max Kellermann
cf23fd8774 fs/io/FileOutputStream: add constructor with directory fd 2019-01-21 21:10:02 +01:00
Max Kellermann
dee8872395 fs/io/FileOutputStream: move code to Open() 2019-01-21 21:09:34 +01:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
2148d4bb31 fs/io/FileOutputStream: fix -Wcomment 2018-10-31 17:18:44 +01:00
Max Kellermann
e79d06d595 fs/io/FileOutputStream: don't use O_TMPFILE on Android
Fixes writing to Context.getCacheDir().
2018-10-31 17:12:21 +01:00
Max Kellermann
c60cf944f5 fs/io/FileOutputStream: add macro HAVE_O_TMPFILE 2018-10-31 17:10:52 +01:00
Max Kellermann
f47696f5f8 fs/StandardDirectory: move USE_XDG to XDG.hxx 2018-10-31 13:39:20 +01:00
Max Kellermann
94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
19d9ce260a fs/io/FileOutputStream: disallow copying 2018-09-03 14:36:01 +02:00
Max Kellermann
0642ce4795 fs/io/FileOutputStream: make linkat() mandatory on Linux 2018-08-21 19:02:03 +02:00
Max Kellermann
d11e1d5880 fs/io/FileOutputStream: add "noexcept" 2018-08-21 18:56:14 +02:00
Max Kellermann
b143477774 fs/io/BufferedReader: add "noexcept" to constructor 2018-08-21 18:52:57 +02:00
Max Kellermann
d092a88a93 system/Open: new UniqueFileDescriptor constructing library 2018-08-21 18:27:39 +02:00
Max Kellermann
ab7597b089 fs/io/FileReader: use class UniqueFileDescriptor 2018-08-21 18:26:36 +02:00
Max Kellermann
84df470008 fs/io/FileReader: use std::exchange() 2018-08-21 18:26:34 +02:00
Max Kellermann
5ca0b7a28f fs/io/FileReader: add "noexcept" 2018-08-21 18:26:09 +02:00
Max Kellermann
21d621e7ad fs/io/FileReader: simplify includes 2018-08-21 18:26:09 +02:00
Max Kellermann
ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann
b98263e86f fs/io/OutputStream: relicense under BSD-2 2018-07-19 14:02:37 +02:00
Max Kellermann
fcbcec6856 fs/List: new library exporting ListWildcard() 2018-07-18 17:18:38 +02:00
Max Kellermann
32290d5eb8 fs/Path: add method ToUTF8Throw() 2018-07-18 16:51:29 +02:00
Max Kellermann
f87265a4d5 fs/AllocatedPath: divert some methods to class Path
Eliminate duplicate code.
2018-07-18 16:51:29 +02:00
Max Kellermann
998227cffc fs/CheckFile: remove variable path_utf8 2018-07-18 16:51:29 +02:00
Max Kellermann
b168a9d469 fs/Traits: add Apply() 2018-07-18 13:06:07 +02:00
Max Kellermann
2b1d6ad396 fs/{,Allocated}Path: add typedef Traits 2018-07-18 13:05:23 +02:00
Max Kellermann
3a4a430f6c fs/Config: use struct ConfigData 2018-07-17 23:09:56 +02:00
Max Kellermann
99d5b61698 fs/Path: add operator/(Path,Path)
Modeled after std::filesystem::operator/() from C++17.
2018-07-17 18:33:32 +02:00
Max Kellermann
816603fd9a config/Config*: rename files, drop "Config" prefix 2018-07-16 19:50:07 +02:00
Max Kellermann
97f670658f util/StringFormat: new utility library 2018-01-24 13:28:28 +01:00
Max Kellermann
bbc5212436 fs/AllocatedPath: make the nullptr_t constructor public 2018-01-17 12:17:41 +01:00
Max Kellermann
c4f7740b80 fs/Path: replace method Null() with nullptr_t constructor 2018-01-17 12:16:21 +01:00
Max Kellermann
5a728a069e fs/AllocatedPath: drop obsolete GCC check 2017-12-27 08:50:55 +01:00
Max Kellermann
914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01:00
Max Kellermann
6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann
dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann
49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00
Max Kellermann
c00b6ff999 fs/FileSystem: use UniqueFileDescriptor in TruncateFile() 2017-08-10 19:40:47 +02:00
Max Kellermann
df5cc3f0f6 fs/FileSystem: OpenFile() returns UniqueFileDescriptor 2017-08-10 19:34:52 +02:00
Max Kellermann
501a4af914 util/StringUtil: move strip functions to StringStrip.cxx 2017-07-05 17:20:02 +02:00
Max Kellermann
979f1b6c39 release v0.20.9
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkz5jkQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEubuD/kBXMcV4XawqGNNtSHdrY8CxSL8wJMCMJQl
 aMgRkKLPRml8Hj9FNNG9pjXBuT+qUgPX7t9gBEiT7c+sV3fHH40gUf1js5GIsEPm
 BAVfvww5EhmQWWVhPTLk1iZ4jp6E96mDmIG1znwo7etSZHXU8RJfR7woBi3SPJ9f
 OPcrimskNuWpAWeaEIKi/1Iwzy8d9VK9Ttb73gA3M5zSm7ioXzt3YClpwLRM8JU6
 QeUJchy6VwXnygswjUNmbhPc3GsD2FyUZ4OtJ0hodnqqajfldBxhcHUnQk4zZULr
 1nLSyOuA9bwLuFohH1T6HiY9z8PFzgqdIHvsjOJgZ4gQa69PVNjal2tUEUav9zFv
 aK4LvTVPnIk+hqRbtLpV7/rPKuClrC9BO4oYdBGBDNY4hqVpvRA9obP1s00aOi+K
 UhYqLqg7yeIEeTlUxFOhXJCKAEL69BuXT5ihJtDlB/dCUzv37sEch/4WDgs7uc+O
 9kJYlElvozw57mbczsee/PCSnSWrLCq/qG/bNEUUQOTueWNuifh3PL62UXGgfbEH
 01hJDyLr6ETSmWn7rjTfLJiHThX/EQQvOhs+35fbCyry65z4tFwrilGDmFVUWGPq
 /6QEpY1D6q4fkoma/iWOZoTkfKewatAPGMGWoJaGhCnfQFz4VTFtS2bDtuUctQ16
 jnXnPFxqBw==
 =0SSp
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.9'

release v0.20.9
2017-06-04 12:57:05 +02:00
Max Kellermann
a057b4f6d8 *: add lost of "noexcept" specifications 2017-06-04 12:46:48 +02:00
Max Kellermann
4faef28cc5 release v0.20.7
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkaFL0QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEr4ID/9iAQC+7fFv06uLOm48Ufu+PgoD8uJkAwF5
 QuLQkc85g9urn+bu9N7Qs7Vypp7aLyGcJKY0jyA8wxkOj24pUC3GYk80daUt561V
 5s20FnoS/Uoman3CSJL94IfCUBxejizE6vgIIHTc5bb6U0qIsPub/8JTTE2Ih7uP
 nvFZ5uBQ+YTc7at+iIH9123eUMKkitkh8osNblovqQT9v42++Tm4ztAytRHBjwUA
 Itew5HhlvahbLKqFs/7vmICh/YX1FcOV7cV+erEWYfkH0KCI2bhSle4u2d0CBOvD
 VJlDnBCo9bM7WKcPYqJiFFFXA0CRk06wbkkkAtwF4zjp8xos7aQcq4FyQnYL8KXo
 5lijIhRwBURBd+nt8oA9kuEhBt/T75otcemJkzVaYappHTJCLjhxSGcPt8mw+nE9
 9WQzsp/MIVzg9l5g3D9S/43xM7uhvn98Tn1Qf2s8YRd2o8CZeOhW+X3RvbCvVPv2
 mOlx4sFAv8DOJ3KxMdqiJT+PmylPyJluQdqH+tMc8BdPg/kpSpYIPTuSjjRqK1yh
 ld5do0HtAAwiHtvXfk5YVFjJSpO0c8yVn6xci2Cl4k/5ZHj2UE1ln+N5vCea2BRF
 2J3HAjROwtcwY3lU1jFnEAogf24KWiFJqhhC0EqBGUdlrM8Dn37P5cEWWjROIMNK
 lPEdovokNw==
 =CdDy
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.7'

release v0.20.7
2017-05-15 23:01:49 +02:00
Max Kellermann
788e3b31e1 *: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a
recent clang version implements an optimization which pushes the
definition's boundary beyond what I believed it was.  clang now
assumes that functions declared "pure" cannot throw exceptions, even
if they lack the "noexcept" specification.

When compiled with this new clang version, MPD will crash randomly if
an exception happens to get thrown by such as "pure" function
(https://github.com/MusicPlayerDaemon/MPD/issues/41).

This commit removes all such misplaced "pure" and "const" attributes,
closing #41.
2017-05-08 17:25:06 +02:00
Max Kellermann
71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann
cd522f524d fs/Traits: allow base to end with a slash in Relative()
Fixes false negatives:

 http://foo/dav/example.ogg mismatches http://foo/dav/

.. because StringAfterPrefix() returns just "example.ogg", without
trailing slash (it existed, but was eaten already by the base
matcher).
2017-02-24 13:50:29 +01:00
Max Kellermann
329c3ab21b fs/FileInfo: use std::chrono::system_clock 2017-02-10 23:48:21 +01:00
Max Kellermann
8aae9766e5 fs/io/*: make constructors "explicit" 2017-01-04 10:41:04 +01:00
Max Kellermann
288b98ccbf fs/io/GunzipReader: use C++11 initializer 2017-01-04 10:37:34 +01:00
Max Kellermann
bde50b1be8 fs/io/{GunzipReader,GzipOutputStream: remove deprepcated dynamic exception specifications 2017-01-04 10:33:24 +01:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
6caf53d1c2 fs/FileSystem: RenameFile() throws exception on error 2016-12-04 19:59:33 +01:00
Max Kellermann
dee6e498d9 fs/CheckFile: use IsAccessDenied() 2016-12-04 19:56:25 +01:00
Max Kellermann
22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann
f4bb18b05e fs/AllocatedPath: remove the obsolete class Error overload 2016-11-10 12:55:08 +01:00
Max Kellermann
07a51957ee fs/FileInfo: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann
37c4470f10 fs/CheckFile: use FileInfo(Path) instead of GetFileInfo() 2016-11-10 12:55:08 +01:00
Max Kellermann
403f0f8c64 SongLoader, ...: include cleanup 2016-11-07 09:01:57 +01:00
Max Kellermann
2f2b394d72 fs/StandardDirectory: no /etc/passwd lookups on Android
This doesn't make sense on Android; there is no home directory for
users.
2016-10-26 17:00:17 +02:00
Max Kellermann
ba181ae9df fs/io/FileOutputStream: work around -Wunused 2016-10-26 17:00:17 +02:00
Max Kellermann
d84f96a571 fs/io/FileOutputStream: add mode CREATE_VISIBLE 2016-09-04 13:16:37 +02:00
Max Kellermann
f600e226da fs/io/FileOutputStream: add mode APPEND_OR_CREATE 2016-09-04 13:16:33 +02:00
Max Kellermann
d775f13a03 fs/io/FileOutputStream: merge all classes into one, add enum Mode
Prepare to add more modes.
2016-09-04 12:57:41 +02:00
Max Kellermann
b630afdeda fs/io/BufferedOutputStream: add wchar_t overloads 2016-09-04 12:57:41 +02:00
Max Kellermann
c39c259078 fs/io/BufferedOutputStream: add Write(char) 2016-09-04 12:57:41 +02:00
Max Kellermann
889be6e29d fs/io/FileReader: add methods GetSize(), GetPosition() 2016-08-27 12:20:59 +02:00
Max Kellermann
d15f64ae5d fs/io/BufferedReader: add method Reset() 2016-08-27 12:09:57 +02:00
Max Kellermann
a07117ea55 fs/io/FileReader: add method Rewind() 2016-08-27 12:09:17 +02:00
Max Kellermann
8748b2dc3f fs/io/BufferedReader: add ReadFull(size_t) 2016-08-16 12:09:04 +02:00
Max Kellermann
5f66af3712 fs/io/BufferedReader: add missing Consume() call 2016-08-16 11:47:31 +02:00
Max Kellermann
31ae50b137 fs/io/BufferedReader: add method ReadFull() 2016-08-16 08:46:44 +02:00
Max Kellermann
07e58ae64f fs/io/FileReader: add missing include 2016-08-16 07:58:44 +02:00
Max Kellermann
a88d18148c fs/io/FileOutputStream: change #if to #ifdef 2016-08-16 07:49:30 +02:00