MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Static Public Member Functions
SimpleDatabase Class Reference

`#include <SimpleDatabasePlugin.hxx>`

Inheritance diagram for SimpleDatabase:
[legend]
Collaboration diagram for SimpleDatabase:
[legend]

## Public Member Functions
gcc_pure Directory & | GetRoot ()
void | Save ()
bool | FileExists () const
| Returns true if there is a valid database file on the disk. More...
gcc_nonnull_all void | Mount (const char *uri, Database *db)
gcc_nonnull_all void | Mount (const char *local_uri, const char *storage_uri)
| Throws #std::runtime_error on error. More...
gcc_nonnull_all bool | Unmount (const char *uri)
void | Open () override
| Open the database. More...
void | Close () override
| Close the database, free allocated memory. More...
const LightSong * | GetSong (const char *uri_utf8) const override
| Look up a song (including tag data) in the database. More...
void | ReturnSong (const LightSong *song) const override
| Mark the song object as "unused". More...
void | Visit (const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song, VisitPlaylist visit_playlist) const override
| Visit the selected entities. More...
void | VisitUniqueTags (const DatabaseSelection &selection, TagType tag_type, tag_mask_t group_mask, VisitTag visit_tag) const override
| Visit all unique tag values. More...
DatabaseStats | GetStats (const DatabaseSelection &selection) const override
time_t | GetUpdateStamp () const override
| Returns the time stamp of the last database update. More...
Public Member Functions inherited from Database
| Database (const DatabasePlugin &_plugin)
virtual | ~Database ()
| Free instance data. More...
const DatabasePlugin & | GetPlugin () const
bool | IsPlugin (const DatabasePlugin &other) const
void | Visit (const DatabaseSelection &selection, VisitDirectory visit_directory, VisitSong visit_song) const
void | Visit (const DatabaseSelection &selection, VisitSong visit_song) const
virtual unsigned | Update (gcc_unused const char *uri_utf8, gcc_unused bool discard)
| Update the database. More...

## Static Public Member Functions
static Database * | Create (EventLoop &loop, DatabaseListener &listener, const ConfigBlock &block)

## Detailed Description

Definition at line 38 of file SimpleDatabasePlugin.hxx.

## Member Function Documentation

void SimpleDatabase::Close | ( |  | ) |
| override virtual

Close the database, free allocated memory.

Reimplemented from Database.

static Database* SimpleDatabase::Create | ( | EventLoop & | loop,
|  | DatabaseListener & | listener,
|  | const ConfigBlock & | block
| ) |  |
| static

bool SimpleDatabase::FileExists | ( |  | ) | const
| inline

Returns true if there is a valid database file on the disk.

Definition at line 90 of file SimpleDatabasePlugin.hxx.

gcc_pure Directory& SimpleDatabase::GetRoot | ( |  | ) |
| inline

Definition at line 79 of file SimpleDatabasePlugin.hxx.

const LightSong* SimpleDatabase::GetSong | ( | const char * | uri_utf8 | ) | const
| override 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)

Implements Database.

DatabaseStats SimpleDatabase::GetStats | ( | const DatabaseSelection & | selection | ) | const
| override virtual

Implements Database.

time_t SimpleDatabase::GetUpdateStamp | ( |  | ) | const
| inline override virtual

Returns the time stamp of the last database update.

Returns 0 if that is not not known/available.

Implements Database.

Definition at line 128 of file SimpleDatabasePlugin.hxx.

gcc_nonnull_all void SimpleDatabase::Mount | ( | const char * | uri,
|  | Database * | db
| ) |  |

Parameters

  db | the Database to be mounted; must be "open"; on success, this object gains ownership of the given Database

gcc_nonnull_all void SimpleDatabase::Mount | ( | const char * | local_uri,
|  | const char * | storage_uri
| ) |  |

Throws #std::runtime_error on error.

void SimpleDatabase::Open | ( |  | ) |
| override virtual

Open the database.

Read it into memory if applicable.

Throws DatabaseError or std::runtime_error on error.

Reimplemented from Database.

void SimpleDatabase::ReturnSong | ( | const LightSong * | song | ) | const
| override virtual

Mark the song object as "unused".

Call this on objects returned by GetSong().

Implements Database.

void SimpleDatabase::Save | ( |  | ) |

gcc_nonnull_all bool SimpleDatabase::Unmount | ( | const char * | uri | ) |

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

Visit the selected entities.

Implements Database.

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

Visit all unique tag values.

Implements Database.

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

- db/plugins/simple/SimpleDatabasePlugin.hxx