ocarina/core/tags/artist.cpp
Anna Schumaker 8a4e9fc2bc core/database: Convert class to a struct
In addition, we lowercase variable names and add a db_ prefix to all
struct members.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:41:33 -05:00

35 lines
538 B
C++

/**
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/tags/artist.h>
static database<Artist> artist_db("artist.db", true);
Artist :: Artist() : GenericTag() {}
Artist :: Artist(const std::string &name)
: GenericTag(name)
{
}
void tags :: init_artist_db()
{
artist_db.load();
}
Artist *tags :: get_artist(const std::string &name)
{
Artist *ret = artist_db.find(name);
if (ret)
return ret;
return artist_db.insert(Artist(name));
}
Artist *tags :: get_artist(const unsigned int index)
{
return artist_db.at(index);
}