20 #ifndef MPD_DETACHED_SONG_HXX
21 #define MPD_DETACHED_SONG_HXX
91 :uri(std::move(_uri)) {}
95 :uri(std::forward<U>(_uri)),
96 tag(std::move(_tag)) {}
109 uri = std::forward<T>(_uri);
118 return !real_uri.empty();
127 return (
HasRealURI() ? real_uri : uri).c_str();
132 real_uri = std::forward<T>(_uri);
141 return uri == other.uri &&
142 start_time == other.start_time &&
143 end_time == other.end_time;
147 bool IsURI(
const char *other_uri)
const {
148 return uri == other_uri;
178 tag = std::move(_tag);
182 tag = std::move(other.
tag);
gcc_pure bool IsAbsoluteFile() const
gcc_pure const char * GetURI() const
bool Update()
Update the #tag and #mtime.
const Tag & GetTag() const
gcc_pure const char * GetRealURI() const
Returns "real" URI (#real_uri) and falls back to just GetURI().
static constexpr SongTime zero()
The meta information about a song file.
gcc_pure bool IsInDatabase() const
gcc_pure bool IsRemote() const
A time stamp within a song.
void SetLastModified(time_t _value)
gcc_pure SignedSongTime GetDuration() const
time_t GetLastModified() const
void SetEndTime(SongTime _value)
DetachedSong(const std::string &_uri)
bool LoadFile(Path path)
Load #tag and #mtime from a local file.
void SetRealURI(T &&_uri)
gcc_pure gcc_nonnull_all bool IsURI(const char *other_uri) const
A path name in the native file system character set.
DetachedSong(const char *_uri)
void MoveTagFrom(DetachedSong &&other)
void MoveItemsFrom(Tag &&other)
Similar to the move operator, but move only the TagItem array.
DetachedSong(std::string &&_uri)
gcc_pure bool HasRealURI() const
Does this object have a "real" URI different from the displayed URI?
gcc_pure bool IsFile() const
friend DetachedSong DatabaseDetachSong(const Storage &db, const LightSong &song)
"Detach" the Song object, i.e.
const Tag * tag
Must not be nullptr.
A variant of SongTime that is based on a signed integer.
void SetTag(const Tag &_tag)
void SetStartTime(SongTime _value)
SongTime GetStartTime() const
SongTime GetEndTime() const
DetachedSong(U &&_uri, Tag &&_tag)
void MoveTagItemsFrom(DetachedSong &&other)
Similar to the MoveTagFrom(), but move only the TagItem array.
gcc_pure bool IsSame(const DetachedSong &other) const
Returns true if both objects refer to the same physical song.
A reference to a song file.