Mapper: add function map_song_detach()

Make the DetachedSong(Song) conversion constructor private.  Everybody
should use map_song_detach() which will take over more
responsibilities soon.
This commit is contained in:
Max Kellermann
2014-01-14 23:28:36 +01:00
parent 75b847132a
commit 61b01f82ef
7 changed files with 27 additions and 5 deletions

View File

@@ -32,6 +32,8 @@
struct Song;
class DetachedSong {
friend DetachedSong map_song_detach(const Song &song);
/**
* An UTF-8-encoded URI referring to the song file. This can
* be one of:
@@ -60,6 +62,8 @@ class DetachedSong {
*/
unsigned end_ms;
explicit DetachedSong(const Song &other);
public:
explicit DetachedSong(const DetachedSong &other)
:uri(other.uri),
@@ -67,8 +71,6 @@ public:
mtime(other.mtime),
start_ms(other.start_ms), end_ms(other.end_ms) {}
explicit DetachedSong(const Song &other);
explicit DetachedSong(const char *_uri)
:uri(_uri),
mtime(0), start_ms(0), end_ms(0) {}