aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateContainer.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/UpdateContainer.cxx (renamed from src/update_container.c)36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/update_container.c b/src/UpdateContainer.cxx
index bda95dabe..daa7f1ec4 100644
--- a/src/update_container.c
+++ b/src/UpdateContainer.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,16 +18,18 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_container.h"
-#include "update_internal.h"
-#include "update_db.h"
-#include "db_lock.h"
-#include "directory.h"
+#include "UpdateContainer.hxx"
+#include "UpdateInternal.hxx"
+#include "UpdateDatabase.hxx"
+#include "DatabaseLock.hxx"
+#include "Directory.hxx"
#include "song.h"
-#include "mapper.h"
#include "decoder_plugin.h"
-#include "tag.h"
+#include "Mapper.hxx"
+
+extern "C" {
#include "tag_handler.h"
+}
#include <glib.h>
@@ -39,11 +41,11 @@
*
* The caller must lock the database.
*/
-static struct directory *
-make_directory_if_modified(struct directory *parent, const char *name,
+static Directory *
+make_directory_if_modified(Directory *parent, const char *name,
const struct stat *st)
{
- struct directory *directory = directory_get_child(parent, name);
+ Directory *directory = parent->FindChild(name);
// directory exists already
if (directory != NULL) {
@@ -57,13 +59,13 @@ make_directory_if_modified(struct directory *parent, const char *name,
modified = true;
}
- directory = directory_make_child(parent, name);
+ directory = parent->MakeChild(name);
directory->mtime = st->st_mtime;
return directory;
}
bool
-update_container_file(struct directory *directory,
+update_container_file(Directory *directory,
const char *name,
const struct stat *st,
const struct decoder_plugin *plugin)
@@ -72,8 +74,7 @@ update_container_file(struct directory *directory,
return false;
db_lock();
- struct directory *contdir =
- make_directory_if_modified(directory, name, st);
+ Directory *contdir = make_directory_if_modified(directory, name, st);
if (contdir == NULL) {
/* not modified */
db_unlock();
@@ -101,13 +102,12 @@ update_container_file(struct directory *directory,
g_free(child_path_fs);
db_lock();
- directory_add_song(contdir, song);
+ contdir->AddSong(song);
db_unlock();
modified = true;
- g_message("added %s/%s",
- directory_get_path(directory), vtrack);
+ g_message("added %s/%s", directory->GetPath(), vtrack);
g_free(vtrack);
}