ocarina/core/tags/library.cpp

57 lines
722 B
C++
Raw Normal View History

/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/tags/library.h>
Library :: Library()
: _size(0), _enabled(false)
{
}
Library :: Library(const std::string &path)
: _size(0), _path(path), _enabled(true)
{
}
const std::string Library :: primary_key() const
{
return _path;
}
void Library :: read(File &file)
{
file >> _enabled;
_path = file.getline();
}
void Library :: write(File &file)
{
file << _enabled << " " << _path;
}
const bool Library :: enabled()
{
return _enabled;
}
void Library :: set_enabled(bool enabled)
{
_enabled = enabled;
}
const unsigned int Library :: size()
{
return _size;
}
void Library :: inc_size()
{
_size++;
}
void Library :: dec_size()
{
_size--;
}