|
MPD
0.20.18
|
#include <Directory.hxx>
Data Structures | |
| struct | LookupResult |
Public Types | |
| typedef boost::intrusive::link_mode< link_mode > | LinkMode |
| typedef boost::intrusive::list_member_hook< LinkMode > | Hook |
| typedef boost::intrusive::member_hook< Directory, Hook, &Directory::siblings > | SiblingsHook |
| typedef boost::intrusive::list< Directory, SiblingsHook, boost::intrusive::constant_time_size< false > > | List |
Public Member Functions | |
| Directory (std::string &&_path_utf8, Directory *_parent) | |
| ~Directory () | |
| bool | IsMount () const |
| void | Delete () |
| Remove this Directory object from its parent and free it. More... | |
| Directory * | CreateChild (const char *name_utf8) |
| Create a new Directory object as a child of the given one. More... | |
| gcc_pure const Directory * | FindChild (const char *name) const noexcept |
| Caller must lock the db_mutex. More... | |
| gcc_pure Directory * | FindChild (const char *name) noexcept |
| Directory * | MakeChild (const char *name_utf8) |
| Look up a sub directory, and create the object if it does not exist. More... | |
| gcc_pure LookupResult | LookupDirectory (const char *uri) noexcept |
| Looks up a directory by its relative URI. More... | |
| gcc_pure bool | IsEmpty () const noexcept |
| gcc_pure const char * | GetPath () const noexcept |
| gcc_pure const char * | GetName () const noexcept |
| Returns the base name of the directory. More... | |
| gcc_pure bool | IsRoot () const noexcept |
| Is this the root directory of the music database? More... | |
| template<typename T > | |
| void | ForEachChildSafe (T &&t) |
| template<typename T > | |
| void | ForEachSongSafe (T &&t) |
| gcc_pure const Song * | FindSong (const char *name_utf8) const noexcept |
| Look up a song in this directory by its name. More... | |
| gcc_pure Song * | FindSong (const char *name_utf8) noexcept |
| void | AddSong (Song *song) |
| Add a song object to this directory. More... | |
| void | RemoveSong (Song *song) noexcept |
| Remove a song object from this directory (which effectively invalidates the song object, because the "parent" attribute becomes stale), but does not free it. More... | |
| void | PruneEmpty () noexcept |
| Caller must lock the db_mutex. More... | |
| void | Sort () noexcept |
| Sort all directory entries recursively. More... | |
| void | Walk (bool recursive, const SongFilter *match, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist) const |
| Caller must lock db_mutex. More... | |
| gcc_pure LightDirectory | Export () const noexcept |
Static Public Member Functions | |
| static gcc_malloc Directory * | NewRoot () |
| Create a new root Directory object. More... | |
Data Fields | |
| Hook | siblings |
| Pointers to the siblings of this directory within the parent directory. More... | |
| List | children |
| A doubly linked list of child directories. More... | |
| SongList | songs |
| A doubly linked list of songs within this directory. More... | |
| PlaylistVector | playlists |
| Directory * | parent |
| time_t | mtime |
| uint64_t | inode |
| uint64_t | device |
| std::string | path |
| Database * | mounted_database |
| If this is not nullptr, then this directory does not really exist, but is a mount point for another Database. More... | |
Static Public Attributes | |
| static constexpr auto | link_mode = boost::intrusive::normal_link |
Definition at line 49 of file Directory.hxx.
| typedef boost::intrusive::list_member_hook<LinkMode> Directory::Hook |
Definition at line 52 of file Directory.hxx.
| typedef boost::intrusive::link_mode<link_mode> Directory::LinkMode |
Definition at line 51 of file Directory.hxx.
| typedef boost::intrusive::list<Directory, SiblingsHook, boost::intrusive::constant_time_size<false> > Directory::List |
Definition at line 67 of file Directory.hxx.
| typedef boost::intrusive::member_hook<Directory, Hook, &Directory::siblings> Directory::SiblingsHook |
Definition at line 65 of file Directory.hxx.
| Directory::Directory | ( | std::string && | _path_utf8, |
| Directory * | _parent | ||
| ) |
| Directory::~Directory | ( | ) |
| void Directory::AddSong | ( | Song * | song | ) |
Add a song object to this directory.
Its "parent" attribute must be set already.
| Directory* Directory::CreateChild | ( | const char * | name_utf8 | ) |
| void Directory::Delete | ( | ) |
|
noexcept |
Caller must lock the db_mutex.
Definition at line 139 of file Directory.hxx.
Look up a song in this directory by its name.
Caller must lock the db_mutex.
Definition at line 234 of file Directory.hxx.
|
inline |
Definition at line 208 of file Directory.hxx.
|
inline |
Definition at line 217 of file Directory.hxx.
|
noexcept |
Returns the base name of the directory.
|
inlinenoexcept |
Definition at line 189 of file Directory.hxx.
|
inlinenoexcept |
Definition at line 182 of file Directory.hxx.
|
inline |
Definition at line 111 of file Directory.hxx.
|
inlinenoexcept |
Is this the root directory of the music database?
Definition at line 203 of file Directory.hxx.
|
noexcept |
Looks up a directory by its relative URI.
| uri | the relative URI |
|
inline |
Look up a sub directory, and create the object if it does not exist.
Caller must lock the db_mutex.
Definition at line 150 of file Directory.hxx.
|
inlinestatic |
Create a new root Directory object.
Definition at line 107 of file Directory.hxx.
|
noexcept |
Caller must lock the db_mutex.
|
noexcept |
Remove a song object from this directory (which effectively invalidates the song object, because the "parent" attribute becomes stale), but does not free it.
|
noexcept |
Sort all directory entries recursively.
Caller must lock the db_mutex.
| void Directory::Walk | ( | bool | recursive, |
| const SongFilter * | match, | ||
| VisitDirectory | visit_directory, | ||
| VisitSong | visit_song, | ||
| VisitPlaylist | visit_playlist | ||
| ) | const |
Caller must lock db_mutex.
| List Directory::children |
A doubly linked list of child directories.
This attribute is protected with the global db_mutex. Read access in the update thread does not need protection.
Definition at line 75 of file Directory.hxx.
| uint64_t Directory::device |
Definition at line 89 of file Directory.hxx.
| uint64_t Directory::inode |
Definition at line 89 of file Directory.hxx.
|
static |
Definition at line 50 of file Directory.hxx.
| Database* Directory::mounted_database |
If this is not nullptr, then this directory does not really exist, but is a mount point for another Database.
Definition at line 97 of file Directory.hxx.
| time_t Directory::mtime |
Definition at line 88 of file Directory.hxx.
| Directory* Directory::parent |
Definition at line 87 of file Directory.hxx.
| std::string Directory::path |
Definition at line 91 of file Directory.hxx.
| PlaylistVector Directory::playlists |
Definition at line 85 of file Directory.hxx.
| Hook Directory::siblings |
Pointers to the siblings of this directory within the parent directory.
It is unused (undefined) in the root directory.
This attribute is protected with the global db_mutex. Read access in the update thread does not need protection.
Definition at line 62 of file Directory.hxx.
| SongList Directory::songs |
A doubly linked list of songs within this directory.
This attribute is protected with the global db_mutex. Read access in the update thread does not need protection.
Definition at line 83 of file Directory.hxx.
1.8.14