2014-11-10 08:27:31 -05:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#include <core/tags/library.h>
|
|
|
|
|
|
|
|
Library :: Library()
|
2014-11-13 08:14:29 -05:00
|
|
|
: _enabled(false), count(0)
|
2014-11-10 08:27:31 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Library :: Library(const std::string &s)
|
2014-11-13 08:14:29 -05:00
|
|
|
: _path(s), _enabled(true), count(0)
|
2014-11-10 08:27:31 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string Library :: primary_key() const
|
|
|
|
{
|
2014-11-12 08:31:09 -05:00
|
|
|
return _path;
|
2014-11-10 08:27:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void Library :: read(File &f)
|
|
|
|
{
|
2014-11-13 08:14:29 -05:00
|
|
|
f >> _enabled;
|
2014-11-12 08:31:09 -05:00
|
|
|
_path = f.getline();
|
2014-11-10 08:27:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void Library :: write(File &f)
|
|
|
|
{
|
2014-11-13 08:14:29 -05:00
|
|
|
f << _enabled << " " << _path;
|
|
|
|
}
|
|
|
|
|
|
|
|
const bool Library :: enabled()
|
|
|
|
{
|
|
|
|
return _enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Library :: set_enabled(bool enabled)
|
|
|
|
{
|
|
|
|
_enabled = enabled;
|
2014-11-10 08:27:31 -05:00
|
|
|
}
|