From d71f726c42963d55809605b4dc4144970ca0f230 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 16 May 2023 14:11:38 +1000 Subject: Add pagination to database queries --- src/database/include/song.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/database/include/song.hpp') diff --git a/src/database/include/song.hpp b/src/database/include/song.hpp index e51e5587..9a84e124 100644 --- a/src/database/include/song.hpp +++ b/src/database/include/song.hpp @@ -4,6 +4,7 @@ #include #include +#include #include "leveldb/db.h" #include "span.hpp" @@ -133,16 +134,20 @@ class SongData { */ class Song { public: - Song(SongData data, SongTags tags) : data_(data), tags_(tags) {} + Song(const SongData& data, const SongTags& tags) : data_(data), tags_(tags) {} + Song(const Song& other) = default; - auto data() -> const SongData& { return data_; } - auto tags() -> const SongTags& { return tags_; } + auto data() const -> const SongData& { return data_; } + auto tags() const -> const SongTags& { return tags_; } bool operator==(const Song&) const = default; + Song operator=(const Song& other) const { return Song(other); } private: const SongData data_; const SongTags tags_; }; +void swap(Song& first, Song& second); + } // namespace database -- cgit v1.2.3