diff options
author | Max Kellermann <max@duempel.org> | 2012-09-27 23:48:29 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-09-28 00:10:02 +0200 |
commit | 609f6ce66de4d100388531db5a420f155b7bf64d (patch) | |
tree | b2d4810436036634cbef7fe1fe30f1e41c832467 /src/PlaylistFile.h | |
parent | 7298b6c84652a98140805f3d4c85c3d5263c407a (diff) | |
download | mpd-609f6ce66de4d100388531db5a420f155b7bf64d.tar.gz mpd-609f6ce66de4d100388531db5a420f155b7bf64d.tar.xz mpd-609f6ce66de4d100388531db5a420f155b7bf64d.zip |
PlaylistFile: use std::list instead of GPtrArray
Diffstat (limited to '')
-rw-r--r-- | src/PlaylistFile.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/PlaylistFile.h b/src/PlaylistFile.h index 35eda6d7b..ddd2a47ec 100644 --- a/src/PlaylistFile.h +++ b/src/PlaylistFile.h @@ -20,18 +20,32 @@ #ifndef MPD_STORED_PLAYLIST_H #define MPD_STORED_PLAYLIST_H +#ifdef __cplusplus +#include <list> +#include <vector> +#include <string> +#endif + #include <glib.h> #include <stdbool.h> #include <time.h> struct song; -struct stored_playlist_info { - char *name; +#ifdef __cplusplus + +struct PlaylistFileInfo { + std::string name; time_t mtime; }; +typedef std::list<PlaylistFileInfo> PlaylistFileList; + +typedef std::vector<std::string> PlaylistFileContents; + +#endif + extern bool playlist_saveAbsolutePaths; G_BEGIN_DECLS @@ -42,6 +56,10 @@ G_BEGIN_DECLS void spl_global_init(void); +G_END_DECLS + +#ifdef __cplusplus + /** * Determines whether the specified string is a valid name for a * stored playlist. @@ -53,17 +71,11 @@ spl_valid_name(const char *name_utf8); * Returns a list of stored_playlist_info struct pointers. Returns * NULL if an error occurred. */ -GPtrArray * -spl_list(GError **error_r); - -void -spl_list_free(GPtrArray *list); +PlaylistFileList +ListPlaylistFiles(GError **error_r); -GPtrArray * -spl_load(const char *utf8path, GError **error_r); - -void -spl_free(GPtrArray *list); +PlaylistFileContents +LoadPlaylistFile(const char *utf8path, GError **error_r); bool spl_move_index(const char *utf8path, unsigned src, unsigned dest, @@ -87,6 +99,6 @@ spl_append_uri(const char *file, const char *utf8file, GError **error_r); bool spl_rename(const char *utf8from, const char *utf8to, GError **error_r); -G_END_DECLS +#endif #endif |