aboutsummaryrefslogtreecommitdiffstats
path: root/src/Song.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-19 19:57:27 +0100
committerMax Kellermann <max@duempel.org>2014-01-19 23:16:09 +0100
commit64465c1318e227ca625ee2047ec8b6a8f0c2faff (patch)
treecebe7785a4c50b698e29597eb28c70bcca5864ce /src/Song.hxx
parenta506adea41e21e071ac3e88d69824d6dd3a3c925 (diff)
downloadmpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.tar.gz
mpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.tar.xz
mpd-64465c1318e227ca625ee2047ec8b6a8f0c2faff.zip
Song: make the "parent" attribute mandatory
The Song class is only used for database songs now. A Song without a Directory is not possible anymore.
Diffstat (limited to 'src/Song.hxx')
-rw-r--r--src/Song.hxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Song.hxx b/src/Song.hxx
index 824fb429c..0b94fe6d0 100644
--- a/src/Song.hxx
+++ b/src/Song.hxx
@@ -54,7 +54,7 @@ struct Song {
* the current database plugin does not manage the parent
* directory this way.
*/
- Directory *parent;
+ Directory *const parent;
time_t mtime;
@@ -75,15 +75,15 @@ struct Song {
*/
char uri[sizeof(int)];
- Song(const char *_uri, size_t uri_length, Directory *parent);
+ Song(const char *_uri, size_t uri_length, Directory &parent);
~Song();
gcc_malloc
- static Song *NewFrom(DetachedSong &&other, Directory *parent);
+ static Song *NewFrom(DetachedSong &&other, Directory &parent);
/** allocate a new song with a local file name */
gcc_malloc
- static Song *NewFile(const char *path_utf8, Directory *parent);
+ static Song *NewFile(const char *path_utf8, Directory &parent);
/**
* allocate a new song structure with a local file name and attempt to
@@ -91,11 +91,7 @@ struct Song {
* data, nullptr is returned.
*/
gcc_malloc
- static Song *LoadFile(const char *path_utf8, Directory *parent);
-
- static Song *LoadFile(const char *path_utf8, Directory &parent) {
- return LoadFile(path_utf8, &parent);
- }
+ static Song *LoadFile(const char *path_utf8, Directory &parent);
void Free();