MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
Database Class Referenceabstract

`#include <Interface.hxx>`

Inheritance diagram for Database:
[legend]

## Public Member Functions
| Database (const DatabasePlugin &_plugin)
virtual | ~Database ()
| Free instance data. More...
const DatabasePlugin & | GetPlugin () const
bool | IsPlugin (const DatabasePlugin &other) const
virtual void | Open ()
| Open the database. More...
virtual void | Close ()
| Close the database, free allocated memory. More...
virtual const LightSong * | GetSong (const char *uri_utf8) const =0
| Look up a song (including tag data) in the database. More...
virtual void | ReturnSong (const LightSong *song) const =0
| Mark the song object as "unused". More...
virtual void | Visit (const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist) const =0
| Visit the selected entities. More...
void | Visit (const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song) const
void | Visit (const DatabaseSelection &selection, VisitSong visit_song) const
virtual void | VisitUniqueTags (const DatabaseSelection &selection, TagType tag_type, tag_mask_t group_mask, VisitTag visit_tag) const =0
| Visit all unique tag values. More...
virtual gcc_pure DatabaseStats | GetStats (const DatabaseSelection &selection) const =0
virtual unsigned | Update (gcc_unused const char *uri_utf8, gcc_unused bool discard)
| Update the database. More...
virtual gcc_pure time_t | GetUpdateStamp () const =0
| Returns the time stamp of the last database update. More...

## Detailed Description

Definition at line 35 of file Interface.hxx.

## Constructor & Destructor Documentation

Database::Database | ( | const DatabasePlugin & | _plugin | ) |
| inline

Definition at line 39 of file Interface.hxx.

virtual Database::~Database | ( |  | ) |
| inline virtual

Free instance data.

Definition at line 45 of file Interface.hxx.

## Member Function Documentation

virtual void Database::Close | ( |  | ) |
| inline virtual

Close the database, free allocated memory.

Reimplemented in SimpleDatabase.

Definition at line 66 of file Interface.hxx.

const DatabasePlugin& Database::GetPlugin | ( |  | ) | const
| inline

Definition at line 47 of file Interface.hxx.

virtual const LightSong* Database::GetSong | ( | const char * | uri_utf8 | ) | const
| pure virtual

Look up a song (including tag data) in the database.

When you don't need this anymore, call ReturnSong().

Parameters

  uri_utf8 | the URI of the song within the music directory (UTF-8)

Implemented in SimpleDatabase.

virtual gcc_pure DatabaseStats Database::GetStats | ( | const DatabaseSelection & | selection | ) | const
| pure virtual

Implemented in SimpleDatabase.

virtual gcc_pure time_t Database::GetUpdateStamp | ( |  | ) | const
| pure virtual

Returns the time stamp of the last database update.

Returns 0 if that is not not known/available.

Implemented in SimpleDatabase.

bool Database::IsPlugin | ( | const DatabasePlugin & | other | ) | const
| inline

Definition at line 51 of file Interface.hxx.

virtual void Database::Open | ( |  | ) |
| inline virtual

Open the database.

Read it into memory if applicable.

Throws DatabaseError or std::runtime_error on error.

Reimplemented in SimpleDatabase.

Definition at line 60 of file Interface.hxx.

virtual void Database::ReturnSong | ( | const LightSong * | song | ) | const
| pure virtual

Mark the song object as "unused".

Call this on objects returned by GetSong().

Implemented in SimpleDatabase.

virtual unsigned Database::Update | ( | gcc_unused const char * | uri_utf8,
|  | gcc_unused bool | discard
| ) |  |
| inline virtual

Update the database.

Throws #std::runtime_error on error.

Returns
  the job id or 0 if not implemented

Definition at line 119 of file Interface.hxx.

virtual void Database::Visit | ( | const DatabaseSelection & | selection,
|  | VisitDirectory | visit_directory,
|  | VisitSong | visit_song,
|  | VisitPlaylist | visit_playlist
| ) |  | const
| pure virtual

Visit the selected entities.

Implemented in SimpleDatabase.

void Database::Visit | ( | const DatabaseSelection & | selection,
|  | VisitDirectory | visit_directory,
|  | VisitSong | visit_song
| ) |  | const
| inline

Definition at line 91 of file Interface.hxx.

void Database::Visit | ( | const DatabaseSelection & | selection,
|  | VisitSong | visit_song
| ) |  | const
| inline

Definition at line 97 of file Interface.hxx.

virtual void Database::VisitUniqueTags | ( | const DatabaseSelection & | selection,
|  | TagType | tag_type,
|  | tag_mask_t | group_mask,
|  | VisitTag | visit_tag
| ) |  | const
| pure virtual

Visit all unique tag values.

Implemented in SimpleDatabase.

The documentation for this class was generated from the following file:

- db/Interface.hxx