Max Kellermann
9c83d3c78c
fs/io/FileOutputStream: use CREATE_ALWAYS instead of TRUNCATE_EXISTING
...
Fixes yet another breakage of creating the database+state file on
Windows.
2015-02-10 13:41:09 +01:00
Max Kellermann
60e6d1d61b
fs/Charset: convert #ifdef to regular "if"
2015-02-09 07:44:21 +01:00
Max Kellermann
975e275030
fs/Charset: change FixSeparators() API to use std::string&&
2015-02-08 17:52:01 +00:00
Max Kellermann
ff2b427cc1
release v0.19.9
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJU1OdDAAoJECNuiljG20USazsQAKZuhjJJ8vjYCB7G/NGoi9tv
dImBQnQDiQTdE57kxa46loknbPc5/cSAYnLbR4PjQfMBqArtE6sAkAk72LKlYNqt
qMOEKPCBjv8ZjiGDbvL/X+WSKbrpm8iOf3Gu5BRIuWrMK/oXQMe5A028Ziyye//X
XfMKdPWkZFL6h/qGO082eCnCiTJaSRLwP6HSNF2pqv+JuFF7hyLkZvTVXo/ms85E
ezrx3Kjf8TuNX041uuso7qqUsD/sY2jZRZ26qfzJ1ODwJmgIfbXzat+ODFVNne55
E1nh5zpwIUxZ2+d6eJEzwLR3+FpmltPc1YLo2mnetD6f59SzpXjAycPLo1VoOhbQ
s4iXQEzNI2LwDebI3eiMXQaLIorHOGex3L6JYkO5LAqUkPrv/PBCJFJs8ixjCRbl
KL27WmWYiV0xfdCz4TtAxEt48LGMMjDfaSK4Hzo3vN3vZtIEy2p/pS9MhXDdxC8I
vql533N+A9fi2I+7bPauwX5ElOYvGTkDeKqKXDox/jR0zio55APst7IW9OIUCKxo
an98430jeNPhs1CNqxVIJNciC8Q4REmafki7UQiKYDBQjHyq3r6Bp547lnDhUtii
P9PNTyOoJXhV5yEP3upnWCxwH6Vy7IxBnwrEO7aEHs88Ea54iqlZ9XB8TzUw4G/1
I7T7a8yOopRopb04vhr2
=fd8f
-----END PGP SIGNATURE-----
Merge tag 'v0.19.9'
2015-02-06 17:15:31 +01:00
Max Kellermann
d38034bb5c
fs/io/FileOutputStream: don't auto-delete file on WIN32
...
The file handle is never reset to INVALID_HANDLE_VALUE, and thus the
destructor will assume the operation shall be cancelled and will
delete the temporary file.
This was a major breakage for saving the database file and the state
file.
2015-02-06 14:36:55 +01:00
Max Kellermann
6cdb2a4896
fs/io/BufferedReader: count line numbers
...
Replaces the dirty code in config/ConfigFile.cxx.
2015-01-21 23:43:32 +01:00
Max Kellermann
1c3f5517fa
config/Option: convert to strictly-typed enum
2015-01-21 23:30:00 +01:00
Max Kellermann
eaf0662b75
fs/io/FileOutputStream: add static method Create()
2015-01-14 19:44:28 +01:00
Max Kellermann
b043b2a761
fs/AllocatedPath: add operator==
2015-01-13 10:42:29 +01:00
Max Kellermann
8b217d5313
fs/io/FileOutputStream: use O_TMPFILE if available
...
The Linux feature allows writing new files to an invisible file, and
then replace the old file. This preserves the old file if we get
interrupted by some event.
2015-01-06 19:38:55 +01:00
Max Kellermann
81df45a893
fs/io/File{Reader,OutputStream}: use OpenFile()
2015-01-05 23:13:35 +01:00
Max Kellermann
712ed555e6
Copyright year 2015
2015-01-01 19:48:13 +01:00
Max Kellermann
412bedb697
Merge branch 'v0.19.x'
2014-12-26 14:40:32 +01:00
Max Kellermann
95f84afd33
fs/Traits, ...: work around -Wtautological-pointer-compare
...
New in clang 3.6.
2014-12-26 14:34:03 +01:00
Max Kellermann
940cab8620
Merge branch 'v0.18.x' into v0.19.x
2014-12-26 14:28:52 +01:00
Max Kellermann
53f4044890
util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare
...
New in clang 3.6.
2014-12-26 13:43:32 +01:00
Max Kellermann
b227fddec7
fs/Path: add methods GetBase() and GetDirectoryName()
2014-12-02 06:45:57 +01:00
Max Kellermann
bc00c38f9d
lib/icu/Converter: add ICU-based backend
2014-12-01 21:56:48 +01:00
Max Kellermann
6eb1caa417
fs/Config: add HAVE_GLIB check
2014-11-30 20:35:26 +01:00
Max Kellermann
41efc1376e
fs/Config: swap #if/#else
2014-11-30 20:34:32 +01:00
Max Kellermann
87c88fcb27
fs/Charset: move code to wrapper class IcuConverter
...
Prepare for a ICU-based backend without GLib.
2014-11-30 00:31:13 +01:00
Max Kellermann
4f80a129f1
fs/Charset: return std::string from PathFromUTF8()
...
Don't expose pointer that requires the caller to invoke g_free(),
because that's GLib-only.
2014-11-30 00:28:27 +01:00
Max Kellermann
6987f2ba82
fs/Charset: use macro HAVE_FS_CHARSET internally
2014-11-30 00:27:58 +01:00
Max Kellermann
563db580ae
fs/Charset: add DeinitFSCharset()
2014-11-29 23:47:48 +01:00
Max Kellermann
125daea16a
fs/Charset: add macro HAVE_FS_CHARSET
2014-11-29 23:36:44 +01:00
Max Kellermann
fd2c6b8a4b
fs/Charset: return Error on SetFSCharset() failure
...
Don't abort the process, let the caller decide instead.
2014-11-29 23:36:44 +01:00
Max Kellermann
5b1db917bc
fs/Config: remove bogus WIN32 check
2014-11-29 23:36:44 +01:00
Max Kellermann
16a99ad515
Compiler.h: exclude clang from GCC_CHECK_VERSION()
2014-11-28 19:33:09 +01:00
Max Kellermann
b3f5b4932c
configure.ac: add macro MPD_ENABLE_AUTO_PKG
...
Simplify the definition of many build options.
2014-11-21 22:19:57 +01:00
Max Kellermann
dc03f003ac
release v0.18.18
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABAgAGBQJUa62OAAoJECNuiljG20US1CkP/3YaAg76hJDaeFAyi7/10lOs
yI8tPmpQk8S+nuclsBJeIr+9xNRsjb1ebW4tI9uBRxqMT10SF7rMCH/qAmgnS9tQ
6M48hF0o9xegjz4x5BosEJjXtiekYN068Xi/hk+H27guVy14f6Xx7oRpdr5oI/O0
F83D1V2+vs6FuOyn42UQQNHVlYMac5SScHoSFomnwRYWI2wb2ay4H5Dlykb5BUl0
tTjJ2lYwN18vUoMxjmCNS+bLd7jag6FZ/PXntB1zXe22R17eAIuFZAMKaQvnQtUi
QZjFPhpd+mBsZLfokB3belyNNb4F6qSG2W6lZrFRB+SU/LqnY2AL/dxPJD9eiufs
5jEIOw9hNBBKo217+hkPwp5pAF50u11tKXUXbKGeR42zAO0zll/+g2afVwoqdAfD
llPDyQyXiB3tmA1bgJD7u9gaud3UaaXoxajPb5LnmklzGxiN5u1rnoo+E5ppBvQ4
31wPHGpzsjxEC7Xn9hErPP17jYXY1HT/xRb8XZNrFqJVZxSyjqQlDWomhCWDcvPc
Du1PyKaQ08zgElEM5trwC9RjJxQdr0sckQcTnYC/0ksfJ7Nhh8M2yepEI/gmWbnO
JBQ7YzpQhE9oMMH8jzVLLdC44yF6QvXcGQ3D9eUfwvPk9Z70mHlNI3Q6kbZ76U5j
RHLp+oSaxFUXfPdciZaw
=GO+k
-----END PGP SIGNATURE-----
Merge tag 'v0.18.18' into v0.19.x
2014-11-18 21:38:44 +01:00
Florent Le Coz
7e7b403043
Construct a Null AllocatedPath if the filename conversion into UTF8 failed
2014-11-11 17:15:19 +01:00
Max Kellermann
c48733e34f
fs/Charset: work around clang's -Wunused-const-variable
...
MPD_PATH_MAX_UTF8 is only used by GLib-specific code currently.
2014-10-25 00:07:25 +02:00
Max Kellermann
f618065f7c
fs/Traits: use value_type
2014-10-10 19:51:44 +02:00
Max Kellermann
cf06ba6d13
fs/AllocatedPath: add method Steal()
2014-09-28 18:12:20 +02:00
Max Kellermann
a8d800572e
fs/AllocatedPath: API documentation grammar fixes
2014-09-28 18:06:18 +02:00
Max Kellermann
b373c53ce4
*: add missing Compiler.h includes
...
Necessary for "final" on gcc 4.6.
2014-08-30 00:46:52 +02:00
Max Kellermann
8283f23651
fs/io/TextFile: add method Check()
2014-08-11 22:53:48 +02:00
Max Kellermann
7cc25f91ff
fs/io/Reader: add "nonnull" attribute
2014-08-11 22:49:08 +02:00
Max Kellermann
486b5b6bfc
fs/io/TextFile: use AutoGunzipReader
...
Several MPD subsystems can now read gzipped files; for example, the
database file can be gzipped.
2014-08-11 21:48:25 +02:00
Max Kellermann
88a2f128ec
fs/io/AutoGunzipReader: new class
2014-08-11 21:48:25 +02:00
Max Kellermann
45c139cfb3
fs/io/PeekReader: new utility class
2014-08-11 21:48:25 +02:00
Max Kellermann
3a111e5d74
fs/io/GzipOutputStream,GunzipReader: move zlib_domain to src/lib/zlib/Domain.cxx
2014-08-11 21:48:25 +02:00
Max Kellermann
a67a881715
input/GunzipInputStream: new class
2014-08-08 20:11:29 +02:00
Max Kellermann
aa2e4d92e0
fs/io/BufferedReader: new class to replace class TextFile
...
The new class is pluggable, to prepare for gzipped database files.
For now, the TextFile class remains, and will be refactored away
later.
2014-08-07 19:38:25 +02:00
Max Kellermann
0ea66a1275
fs/io/Reader: new interface
2014-08-07 19:38:25 +02:00
Max Kellermann
aafff8fd5c
fs/output, fs/TextFile: move to fs/io/
2014-08-07 19:38:25 +02:00
Max Kellermann
bbea6564fc
fs/output/FileOutputStream: use open_cloexec()
...
Support operating systems that don't have O_CLOEXEC.
2014-08-07 18:16:11 +02:00
Max Kellermann
59d38f876a
util/StringUtil: add StripRight() overload with "end" argument
2014-08-07 16:08:02 +02:00
Max Kellermann
87bcf739ee
util/StringUtil: rename strchug_fast() to StripLeft()
2014-08-07 16:08:02 +02:00
Max Kellermann
17b316b94b
fs/StandardDirectory: pass writable string to ParseConfigLine()
...
Eliminate the std::string overhead.
2014-08-07 16:07:52 +02:00
Max Kellermann
c9a71a7176
fs/GzipOutputStream: new class wrapping zlib
2014-08-06 16:35:10 +02:00
Max Kellermann
0d0ccacdf3
fs/OutputStream: new infrastructure for writing to files
2014-07-30 22:12:02 +02:00
Mantas Mikulėnas
cd289843f7
fs/StandardDirectory: look for cache dir in environment, not user-dirs
...
The XDG cache directory is part of the "base directories" spec like
$XDG_CONFIG_HOME, not "user directories".
2014-07-11 08:09:19 +02:00
Max Kellermann
36ca57a54e
fs/StandardDirectory: add GetUserCacheDir()
...
Move code from CreateConfiguredDatabase() and add XDG support. This
implements an automatic Linux fallback for the setting "db_file" if
none was specified.
2014-03-01 22:51:51 +01:00
Max Kellermann
5268f55344
java/File: add method ToAbsolutePath() returning AllocatedPath
2014-03-01 20:53:39 +01:00
Max Kellermann
58771fc41c
Android: obtain music directory from Environment.getExternalStoragePublicDirectory()
2014-03-01 18:48:20 +01:00
Max Kellermann
8fe004e98e
fs/Charset: use "UTF-8" instead of "utf-8" as the default value
...
The upper-case name seems to be the canonical one.
2014-02-23 22:03:40 +01:00
Max Kellermann
1709ab6810
fs/TextFile: use custom allocation instead of GString
2014-02-17 23:04:10 +01:00
Max Kellermann
ce925ba56f
fs/Charset: disable if GLib is disabled
2014-02-17 22:48:26 +01:00
Max Kellermann
ec8873b178
Mapper: move check_directory() to the filesystem library
2014-02-07 23:25:47 +01:00
Max Kellermann
d744c997d8
fs/Traits: add function Relative()
...
Move code from Path::RelativeFS() and make it generic.
2014-02-07 19:08:51 +01:00
Max Kellermann
c310941f69
fs/AllocatedPath: add conversion constructor from Path
2014-01-30 23:36:57 +01:00
Max Kellermann
c02f146791
fs/DirectoryReader: GetEntry() returns Path, not AllocatedPath
...
Reduce overhead, don't duplicate the string.
2014-01-30 22:20:57 +01:00
Max Kellermann
0bd01824f6
fs/AllocatedPath: add Build() overlays with Path arguments
2014-01-30 22:15:13 +01:00
Max Kellermann
197b503f3e
Config*: move to config/
2014-01-24 00:20:01 +01:00
Max Kellermann
4f83c60296
copyright year 2014
2014-01-13 22:31:55 +01:00
Denis Krjuchkov
5d85792178
fs: implemented standard directories API
2013-12-08 17:24:43 +06:00
Denis Krjuchkov
acba9c0f61
TextFile: move to fs subsystem
2013-12-08 04:15:27 +06:00
Denis Krjuchkov
38afc89407
fs/FileSystem.hxx: don't define CheckAccess() with mode on Windows
2013-12-05 15:05:01 +06:00
Denis Krjuchkov
06d7169674
fs/FileSystem.hxx: add CheckAccess without mode parameter
2013-12-05 15:05:01 +06:00
Denis Krjuchkov
8bf1640932
fs/Traits.cxx: don't return drive path without trailing separator
2013-12-05 15:05:01 +06:00
Denis Krjuchkov
da50c888fe
fs/Traits.hxx: introduce PathTraitsXXX::IsDrive function
2013-12-05 15:05:01 +06:00
Denis Krjuchkov
62dc8e4131
fs/Charset.cxx: replace \ with / when converting path to UTF-8 on Windows
2013-12-05 15:04:52 +06:00
Denis Krjuchkov
cbb9149a82
fs/Traits.hxx: add shorter forms of PathTraitsXXX::Build()
2013-12-05 12:35:28 +06:00
Denis Krjuchkov
dab7348da8
fs/Traits.hxx: add PathTraitsUTF8::GetLength for consistency
2013-12-05 12:35:28 +06:00
Denis Krjuchkov
378e8a6224
fs/AllocatedPath.cxx: don't use g_path_get_dirname
2013-12-05 12:35:28 +06:00
Denis Krjuchkov
289fdcc52b
fs/Traits: implement GetBase/GetParent/Build using templates
2013-12-05 12:35:21 +06:00
Denis Krjuchkov
83e6e3e31f
fs/Traits.cxx: don't return empty string if parent dir is root
2013-12-05 12:27:31 +06:00
Denis Krjuchkov
c387031252
fs/Traits.hxx: add FindLastSeparator function to PathTraitsXXX
2013-12-05 04:09:07 +06:00
Denis Krjuchkov
403bd77eff
fs/Traits: improve compatibility between PathTraitsFS and PathTraitsUTF8
2013-12-05 04:01:29 +06:00
Denis Krjuchkov
b397c46184
fs/Traits.hxx: add gcc_nonnull_all where applicable
2013-12-05 03:56:51 +06:00
Denis Krjuchkov
0a6c4c31b2
fs/Traits: split PathTraits type into PathTraitsFS and PathTraitsUTF8
2013-12-05 03:53:43 +06:00
Denis Krjuchkov
55ed7bd34d
AllocatedPath.hxx: use move constructor
2013-12-03 14:57:26 +06:00
Denis Krjuchkov
eeeef3eab5
fs/AllocatedPath: use PathTraits::BuildFS
2013-12-03 13:50:50 +06:00
Denis Krjuchkov
96413b1604
fs/Traits.hxx: implement BuildFS() method
2013-12-03 13:46:05 +06:00
Denis Krjuchkov
2278fe42e5
fs/Traits.hxx: move definition of AllocatedPath::string to PathTraits
2013-12-03 13:37:35 +06:00
Denis Krjuchkov
3a183f869f
fs/Traits.hxx: add GetLengthFS()
...
There is no GetLengthUTF8() because strlen or std::string::size()
could be used instead.
2013-12-03 12:26:05 +06:00
Denis Krjuchkov
6c5828822c
fs/AllocatedPath.hxx: add FromFS(std::string) method
2013-12-03 12:16:53 +06:00
Denis Krjuchkov
9dd824ba50
fs/Traits.hxx: don't use g_path_is_absolute
2013-12-03 11:59:57 +06:00
Denis Krjuchkov
d744ea3fca
fs/Traits.hxx: simplify code
...
- Move definition of SEPARATOR_UTF8 out of #ifdef
- Remove duplicated check in IsSeparatorUTF8
2013-12-03 11:48:45 +06:00
Max Kellermann
f90abe9530
include cleanup using iwyu
2013-11-28 11:50:54 +01:00
Max Kellermann
20597b3632
*: use nullptr instead of NULL
2013-10-28 23:58:17 +01:00
Max Kellermann
83c726a34f
GetBaseUTF8
2013-10-21 10:50:22 +02:00
Max Kellermann
93068f10ec
fs/AllocatedPath: don't include glib.h
2013-10-21 10:27:14 +02:00
Max Kellermann
abfbd55305
fs/Path: rename to AllocatedPath
...
The new class Path only holds a string pointer without being
responsible for allocation/deallocation. The FileSystem.hxx library
accepts Path arguments instead of AllocatedPath, to avoid forcing
callers to allocate another string object.
2013-10-17 23:43:46 +02:00
Max Kellermann
b3611524f4
fs/Path: move definitions to struct PathTraits
2013-10-17 23:23:25 +02:00
Max Kellermann
a63613dba0
fs/Path: include clenaup
2013-10-17 23:20:26 +02:00
Max Kellermann
7fec2b02d4
fs/Charset: GetFSCharset() returns "utf-8" by default
...
If fs_charset is empty, i.e. we're using the default "utf-8",
GetFSCharset() should return exactly that instead of an empty
std::string.
2013-10-17 22:47:09 +02:00
Max Kellermann
608a98c873
fs/Charset: default filesystem charset is UTF-8
...
Implement a fast path for UTF-8 which leaves fs_charset empty, and
don't assign a value to fs_charset if there's no configuration.
2013-10-17 22:42:22 +02:00
Max Kellermann
f951e5356b
fs/Charset: don't allow nullptr arguments
2013-10-17 22:39:06 +02:00
Max Kellermann
080ee87e07
fs/Path: move configuration code to Config.cxx
2013-10-17 22:29:03 +02:00
Max Kellermann
fa60b9ae94
fs/Path: move path_domain to Domain.hxx
2013-10-17 22:20:53 +02:00
Max Kellermann
0d33ae52c6
fs/Path: make fs_charset static
2013-10-17 22:10:27 +02:00
Max Kellermann
77e4b28092
fs/Path: include cleanup
2013-10-17 22:08:57 +02:00
Max Kellermann
4817437d31
fs/Limits: convert macro to "constexpr"
2013-10-17 22:08:56 +02:00
Max Kellermann
354b5a9365
fs/Path: move MPD_PATH_MAX to Limits.hxx
2013-10-17 22:00:01 +02:00
Max Kellermann
be2951b45f
gcc.h: rename to Compiler.h
2013-10-15 09:21:59 +02:00
Max Kellermann
e4e80ff0cb
*: use WIN32 instead of G_OS_WIN32
2013-10-15 08:33:44 +02:00
Max Kellermann
9508ea982b
fs/Path: add method IsAbsolute()
2013-10-14 22:38:29 +02:00
Max Kellermann
47d655ea7f
fs/Path: add separator constants/functions
2013-10-14 22:26:23 +02:00
Max Kellermann
0b27ac2f5c
fs/Path: add method RelativeFS()
...
Move code from map_fs_to_utf8().
2013-10-14 22:09:02 +02:00
Max Kellermann
b915e43391
fs/Path: add method data()
2013-10-14 21:57:43 +02:00
Max Kellermann
060814daa8
Log: new logging library API
...
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
2013-10-02 08:57:55 +02:00
Max Kellermann
43675717b8
filesystem/Path: use std::string
2013-10-02 08:56:27 +02:00
Max Kellermann
1ee6a78cb7
Path: add FromUTF8() overload that returns an Error
2013-09-12 10:17:41 +02:00
Max Kellermann
bf4ee48efa
ConfigPath: move path_domain to system/Path.cxx
2013-09-12 10:03:37 +02:00
Max Kellermann
7a4c9f5f4c
mpd_error.h: remove obsolete header
...
Migrate the remaining callers to FatalError().
2013-09-05 18:26:46 +02:00
Max Kellermann
26d92c80ed
conf.h: remove obsolete header
...
Use only ConfigData.hxx in plugin sources to reduce header
dependencies.
2013-09-05 08:47:10 +02:00
Max Kellermann
3ac2e9d31f
os/FileSystem: disable mkfifo() wrapper on WIN32
2013-08-07 20:31:27 +02:00
Max Kellermann
b76a29a69a
ConfigPath: return a Path object
...
Migrate all callers to use Path directly, instead of doing the
conversion in each caller.
2013-08-07 19:59:09 +02:00
Max Kellermann
b70d38dc10
Makefile.am: move sources to libsystem.a
2013-08-07 10:31:31 +02:00
Denis Krjuchkov
896015bf53
DirectoryReader: rename Failed() to HasFailed() for consistency with TextFile
2013-05-05 13:34:12 +06:00
Denis Krjuchkov
17dca254a3
Path.hxx: add GetDirectoryName() method
2013-02-02 19:28:02 +06:00
Denis Krjuchkov
f6b50d2387
FileSystem.hxx: add FOpen modes for appending files
2013-02-02 19:20:10 +06:00
Denis Krjuchkov
e98e2a0b07
Path::FromUTF8() returns nulled instance on error, add error handling where required
2013-01-28 00:13:46 +06:00
Denis Krjuchkov
943064bb51
Path: convert remaining funcs to methods, keep fs_charset as std::string
2013-01-28 00:13:46 +06:00
Denis Krjuchkov
7149a8ae4f
Path: merge utf8_to_fs_charset() into Path::FromUTF8()
2013-01-28 00:13:45 +06:00
Denis Krjuchkov
3c7cf94643
Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()
2013-01-28 00:13:45 +06:00
Denis Krjuchkov
3bd35d1883
Path: introduce MPD_PATH_MAX_UTF8
2013-01-28 00:13:45 +06:00
Denis Krjuchkov
e995cd928c
Path: define MPD_PATH_MAX to 260 on Windows
2013-01-26 11:18:12 +06:00
Denis Krjuchkov
292d7c3fdf
Path: ToUTF() returns std::string
2013-01-26 11:16:12 +06:00
Denis Krjuchkov
ef93cdf4a8
Path: move to fs subdirectory
2013-01-22 01:24:53 +06:00
Denis Krjuchkov
4ad90e2d52
FileSystem: extract DirectoryReader, improve the rest
...
- DirectoryReader is extracted to separate header
- FileSystem.cxx/FileSystem.hxx/DirectoryReader.hxx moved to fs/ subdir
- Functions return true on success, instead of 0 (where applicable)
- ReadLink return result instead of out parameter
- UnlinkFile is renamed to RemoveFile
- CheckExists/CheckIsRegular/CheckIsDirectory are renamed
to PathExists/FileExists/DirectoryExists
2013-01-22 01:05:30 +06:00