2009-03-13 18:43:16 +01:00
|
|
|
/*
|
2014-01-13 22:30:36 +01:00
|
|
|
* Copyright (C) 2003-2014 The Music Player Daemon Project
|
2009-03-13 18:43:16 +01:00
|
|
|
* http://www.musicpd.org
|
2008-10-08 11:07:35 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2009-03-13 18:43:16 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-10-08 11:07:35 +02:00
|
|
|
*/
|
|
|
|
|
2013-01-03 00:25:15 +01:00
|
|
|
#ifndef MPD_DATABASE_SIMPLE_HXX
|
|
|
|
#define MPD_DATABASE_SIMPLE_HXX
|
2008-10-08 11:07:35 +02:00
|
|
|
|
2013-10-15 09:21:13 +02:00
|
|
|
#include "Compiler.h"
|
2009-03-02 15:42:21 +01:00
|
|
|
|
2008-10-08 11:07:35 +02:00
|
|
|
#include <sys/time.h>
|
|
|
|
|
2011-09-05 23:03:05 +02:00
|
|
|
struct config_param;
|
2013-01-02 23:06:20 +01:00
|
|
|
struct Directory;
|
2011-09-10 18:48:10 +02:00
|
|
|
struct db_selection;
|
2011-09-10 19:24:30 +02:00
|
|
|
struct db_visitor;
|
2013-08-10 18:02:44 +02:00
|
|
|
class Error;
|
2008-10-08 11:07:35 +02:00
|
|
|
|
2012-08-08 08:19:30 +02:00
|
|
|
/**
|
|
|
|
* Check whether the default #SimpleDatabasePlugin is used. This
|
|
|
|
* allows using db_get_root(), db_save(), db_get_mtime() and
|
|
|
|
* db_exists().
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
db_is_simple(void);
|
|
|
|
|
2009-01-18 16:56:07 +01:00
|
|
|
/**
|
|
|
|
* Returns the root directory object. Returns NULL if there is no
|
|
|
|
* configured music directory.
|
2012-08-08 08:19:30 +02:00
|
|
|
*
|
|
|
|
* May only be used if db_is_simple() returns true.
|
2009-01-18 16:56:07 +01:00
|
|
|
*/
|
2012-08-02 18:15:49 +02:00
|
|
|
gcc_pure
|
2013-01-02 23:06:20 +01:00
|
|
|
Directory *
|
2008-10-08 11:07:55 +02:00
|
|
|
db_get_root(void);
|
2008-10-08 11:07:35 +02:00
|
|
|
|
2012-01-31 22:12:14 +01:00
|
|
|
/**
|
|
|
|
* Caller must lock the #db_mutex.
|
|
|
|
*/
|
2011-09-13 21:36:51 +02:00
|
|
|
gcc_nonnull(1)
|
2012-08-02 18:15:49 +02:00
|
|
|
gcc_pure
|
2013-01-02 23:06:20 +01:00
|
|
|
Directory *
|
2008-10-08 11:07:55 +02:00
|
|
|
db_get_directory(const char *name);
|
2008-10-08 11:07:35 +02:00
|
|
|
|
2012-08-08 08:19:30 +02:00
|
|
|
/**
|
|
|
|
* May only be used if db_is_simple() returns true.
|
|
|
|
*/
|
2009-01-04 21:18:40 +01:00
|
|
|
bool
|
2013-08-10 18:02:44 +02:00
|
|
|
db_save(Error &error);
|
2008-10-08 11:07:35 +02:00
|
|
|
|
2009-01-08 07:36:40 +01:00
|
|
|
/**
|
|
|
|
* Returns true if there is a valid database file on the disk.
|
2012-08-08 08:19:30 +02:00
|
|
|
*
|
|
|
|
* May only be used if db_is_simple() returns true.
|
2009-01-08 07:36:40 +01:00
|
|
|
*/
|
2012-08-02 18:15:49 +02:00
|
|
|
gcc_pure
|
2013-11-22 00:35:29 +01:00
|
|
|
bool
|
|
|
|
db_exists();
|
2009-01-08 07:36:40 +01:00
|
|
|
|
2008-10-08 11:07:35 +02:00
|
|
|
#endif
|