aboutsummaryrefslogtreecommitdiffstats
path: root/AudioFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AudioFile.cpp')
-rw-r--r--AudioFile.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/AudioFile.cpp b/AudioFile.cpp
index 1e5e6fb..bbe1526 100644
--- a/AudioFile.cpp
+++ b/AudioFile.cpp
@@ -166,3 +166,16 @@ AudioFile::AudioFile(const std::string &filename) :
m_isValid = true;
}
+bool AudioFile::operator<(const AudioFile &other) const
+{
+ int comp;
+ if (comp = m_artist.compare(other.m_artist))
+ return comp < 0;
+ if (m_year != other.m_year)
+ return m_year < other.m_year;
+ if (comp = m_album.compare(other.m_album))
+ return comp < 0;
+ if (m_track != other.m_track)
+ return m_track < other.m_track;
+ return m_title.compare(other.m_title) < 0;
+}