Database{Plugin,Visitor}: pass references

This commit is contained in:
Max Kellermann
2012-08-07 21:32:08 +02:00
parent c6a0f5d3f9
commit 1a75abffa5
10 changed files with 95 additions and 91 deletions

@ -48,24 +48,24 @@ my_log_func(const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
}
static bool
DumpDirectory(const struct directory *directory, GError **)
DumpDirectory(const directory &directory, GError **)
{
cout << "D " << directory->path << endl;
cout << "D " << directory.path << endl;
return true;
}
static bool
DumpSong(struct song *song, GError **)
DumpSong(song &song, GError **)
{
cout << "S " << song->parent->path << "/" << song->uri << endl;
cout << "S " << song.parent->path << "/" << song.uri << endl;
return true;
}
static bool
DumpPlaylist(const struct playlist_metadata *playlist,
const struct directory *directory, GError **)
DumpPlaylist(const playlist_metadata &playlist,
const directory &directory, GError **)
{
cout << "P " << directory->path << "/" << playlist->name << endl;
cout << "P " << directory.path << "/" << playlist.name << endl;
return true;
}
@ -133,7 +133,7 @@ main(int argc, char **argv)
db_selection selection;
db_selection_init(&selection, "", true);
if (!db->Visit(&selection, DumpDirectory, DumpSong, DumpPlaylist,
if (!db->Visit(selection, DumpDirectory, DumpSong, DumpPlaylist,
&error)) {
db->Close();
delete db;