2014-11-08 14:43:58 -05:00
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
|
2014-11-08 20:53:08 -05:00
|
|
|
const std::string &GenericTag :: name() const
|
2014-11-08 14:43:58 -05:00
|
|
|
{
|
|
|
|
return _name;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string &GenericTag :: lowercase()
|
|
|
|
{
|
|
|
|
return _lower;
|
|
|
|
}
|