summaryrefslogtreecommitdiff
path: root/src/db/plugins/simple/Directory.cxx
AgeCommit message (Collapse)Author
2020-04-08db/simple: pass std::string_view to Directory::LookupDirectory()Max Kellermann
2020-04-03db/simple/Directory: add LookupResult::uriMax Kellermann
2020-04-03lib/icu/Collate: pass std::string_viewMax Kellermann
2020-04-02db/simple/Directory: reimplement LookupDirectory() without allocationsMax Kellermann
Use std::string_view to avoid modifying the string for the temporary null terminators.
2020-04-02db/simple/Directory: pass std::string_view to several methodsMax Kellermann
2020-04-02Merge tag 'v0.21.22'Max Kellermann
release v0.21.22
2020-04-02db/simple/Directory: optimize GetName() using the parent's pathMax Kellermann
This method gets called a lot during MPD startup, via FindChild() and directory_load_subdir(), so this is worth optimizing at the expense of code readability. This speeds up MPD startup by 10%.
2020-03-12replace assert.h with cassertRosen Penev
The former was deprecated with C++14. According to the C++11 and C++17 standards, both files are identical. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-02[clang-tidy] convert several functions to const &Rosen Penev
Found with performance-unnecessary-value-param Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01*: use `auto`Max Kellermann
2020-01-18copyright year 2020Max Kellermann
2019-09-05db/simple/Directory: RemoveSong() returns SongPtrMax Kellermann
2019-09-04db/simple/Song: rename "uri" to "filename"Max Kellermann
This attribute is not a URI; it is just the filename without its parent directory path. To avoid confusion, let's rename it to "filename", leaving the struct without a "uri" attribute.
2019-09-04db/simple/Song: make "parent" a reference, not a pointerMax Kellermann
2019-09-03db/simple/Song: convert "uri" to a std::stringMax Kellermann
No longer allocate it as a "VarSize". This used to be a clever trick to save memory 10 years ago, but these days, keeping the code maintainable seems more important than saving a few kilobytes of memory.
2019-05-21db/simple/Song: wrap in std::unique_ptr<>Max Kellermann
2019-05-21db/simple/Song: move struct Disposer to separate headerMax Kellermann
Allow forward-declaring it.
2019-02-20db/simple/Directory: close the Database in destructorMax Kellermann
Fixes assertion failure.
2019-02-20db/Plugin: use std::unique_ptr<> to manage Database pointersMax Kellermann
2019-02-20db/simple/Directory: add `noexcept`Max Kellermann
2018-11-19check.h: remove obsolete headerMax Kellermann
Since we switched from autotools to Meson in commit 94592c14062d5afc9482d11baa401648082022c0, 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-10-31*: copyright year 2018Max Kellermann
2018-09-02db/simple: pass DatabaseSelection to WalkMount()Max Kellermann
This passes the new `sort` and `window` attributes to the mounted database.
2018-08-02DetachedSong, db/LightSong, SongFilter: move to src/song/Max Kellermann
2017-12-18Merge tag 'v0.20.13'Max Kellermann
release v0.20.13
2017-12-18Fix `lsinfo` and `add` for mounted databases.FlashSystems
If `SimpleDatabase::Visit` is called on a database that contains a mounted directry the URIs of the elements passed to the callbacks are not prefixed by the mountpoint path. This leads to lsinfo and add not working because they use the wrong URI. This pull request is using the `WalkMount` helper function to create prefixed versions of `VisitDirectory`, `VisitSong` and `VisitPlaylist` to add the correct prefix to the parameters of the callback functions.
2017-12-03Merge branch 'v0.20.x'Max Kellermann
2017-11-27Fix for "Mount-Points are purged from database on update/rescan."FlashSystems
Signed-off-by: FlashSystems <developer@flashsystems.de>
2017-05-15Merge tag 'v0.20.7'Max Kellermann
release v0.20.7
2017-05-08*: add "noexcept" to many, many function prototypesMax Kellermann
This eliminates some overhead, because the compiler doesn't need to consider these functions throwing.
2017-02-11db/simple/Directory: use C++11 initializersMax Kellermann
2017-01-03update copyright yearMax Kellermann
2016-10-29db/Interface: migrate visitor methods from class Error to C++ exceptionsMax Kellermann
2016-10-29db/Visitor: remove the Error parameterMax Kellermann
Implementations shall use exceptions instead.
2016-02-26update copyright year to 2016Max Kellermann
2015-12-16db/DatabaseLock: add class ScopeDatabaseUnlockMax Kellermann
2015-10-19util/DeleteDisposer: new utility classMax Kellermann
2015-01-01Copyright year 2015Max Kellermann
2014-06-16Directory: eliminate attribute "have_stat"Max Kellermann
Check for 0 in "device" and "inode" instead.
2014-06-16db/simple: use class boost::intrusive::listMax Kellermann
Remove the C list_head library and use type-safe C++ instead.
2014-02-27db/simple: mount pointsMax Kellermann
A SimpleDatabase instance can now "mount" other Database instances at certain locations. This is used to use a new SimpleDatabase instance for each storage mount (issued with the "mount" protocol command). Each such instance has its own database file, stored in the directory that is specified with the "cache_directory" option.
2014-02-26db/simple/Directory: eliminate method LookupSong()Max Kellermann
Move to SimpleDatabase::GetSong() to give that method more control.
2014-02-26db/simple/Directory: LookupDirectory() return remaining URIMax Kellermann
Code can now be reused in LookupSong().
2014-02-26db/simple/Directory: make variables more localMax Kellermann
2014-02-26db/simple: create dedicated directoryMax Kellermann