ocarina/core/tags/generic.cpp
Anna Schumaker 2d9d87afc9 Album: Move Album tag into a new file
Also make it inherit from the GenericTag base class.  Also also, add a
unit test specific to Album tags.  Finally, I remove the corresponding
section of the DESIGN file since it is no longer needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-12-04 08:31:49 -05:00

40 lines
618 B
C++

/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/filter.h>
#include <core/tags/generic.h>
GenericTag :: GenericTag() {}
GenericTag :: GenericTag(const std::string &name)
: _name(name), _lower(filter :: lowercase(name))
{
}
const std::string GenericTag :: primary_key() const
{
return _name;
}
void GenericTag :: read(File &file)
{
_name = file.getline();
_lower = filter :: lowercase(_name);
}
void GenericTag :: write(File &file)
{
file << _name;
}
const std::string &GenericTag :: name() const
{
return _name;
}
const std::string &GenericTag :: lowercase()
{
return _lower;
}