ocarina/include/core/tags/genre.h

43 lines
1.0 KiB
C++

/**
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_TAGS_GENRE_H
#define OCARINA_CORE_TAGS_GENRE_H
#include <core/database.h>
/**
* The Genre tag is used to store the name of genres added
* to the tag database.
*/
struct genre : public db_entry {
public:
std::string ge_name; /* This genre's name. */
std::string ge_lower; /* This genre's name (lowercased). */
genre(); /**< Genre tag constructor. */
};
#define GENRE(dbe) ((struct genre *)dbe)
/* Called to initialize the genre database. */
void genre_db_init();
/* Called to clean up the genre database. */
void genre_db_deinit();
/* Called to find a genre tag by name. */
struct genre *genre_find(const std::string &);
/* Called to get a genre tag with a specific index. */
struct genre *genre_get(const unsigned int);
/* Called to compare two genre tags. */
int genre_compare(struct genre *, struct genre *);
#ifdef CONFIG_TESTING
const struct db_ops *test_genre_ops();
#endif /* CONFIG_TESTING */
#endif /* OCARINA_CORE_TAGS_GENRE_H */