40 lines
612 B
C++
40 lines
612 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()
|
||
|
{
|
||
|
return _name;
|
||
|
}
|
||
|
|
||
|
const std::string &GenericTag :: lowercase()
|
||
|
{
|
||
|
return _lower;
|
||
|
}
|