ocarina/core/tags/album.cpp

38 lines
613 B
C++
Raw Normal View History

/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/tags/album.h>
#include <sstream>
Album :: Album() : GenericTag(), _year(0) {}
Album :: Album(const std::string &name, unsigned int year)
: GenericTag(name), _year(year)
{
}
const std::string Album :: primary_key() const
{
std::stringstream ss;
ss << _year << "/" << GenericTag :: primary_key();
return ss.str();
}
void Album :: read(File &file)
{
file >> _year;
GenericTag :: read(file);
}
void Album :: write(File &file)
{
file << _year << " ";
GenericTag :: write(file);
}
unsigned int Album :: year()
{
return _year;
}