MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

StorageInterface.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MPD_STORAGE_INTERFACE_HXX
21 #define MPD_STORAGE_INTERFACE_HXX
22
23 #include "check.h"
24 #include "Compiler.h"
25
26 #include <string>
27
28 struct StorageFileInfo;
29 class AllocatedPath;
30
31 class StorageDirectoryReader {
32 public:
33 StorageDirectoryReader() = default;
34 StorageDirectoryReader(const StorageDirectoryReader &) = delete;
35 virtual ~StorageDirectoryReader() {}
36
37 virtual const char *Read() = 0;
38
42 gcc_pure
43 virtual StorageFileInfo GetInfo(bool follow) = 0;
44 };
45
46 class Storage {
47 public:
48 Storage() = default;
49 Storage(const Storage &) = delete;
50 virtual ~Storage() {}
51
55 gcc_pure
56 virtual StorageFileInfo GetInfo(const char *uri_utf8, bool follow) = 0;
57
61 virtual StorageDirectoryReader *OpenDirectory(const char *uri_utf8) = 0;
62
66 gcc_pure
67 virtual std::string MapUTF8(const char *uri_utf8) const = 0;
68
74 gcc_pure
75 virtual AllocatedPath MapFS(const char *uri_utf8) const;
76
77 gcc_pure
78 AllocatedPath MapChildFS(const char *uri_utf8,
79 const char *child_utf8) const;
80
86 gcc_pure
87 virtual const char *MapToRelativeUTF8(const char *uri_utf8) const = 0;
88 };
89
90 #endif
check.h
Storage::MapChildFS
gcc_pure AllocatedPath MapChildFS(const char *uri_utf8, const char *child_utf8) const
Storage::Storage
Storage()=default
Storage::OpenDirectory
virtual StorageDirectoryReader * OpenDirectory(const char *uri_utf8)=0
Throws #std::runtime_error on error.
StorageDirectoryReader::Read
virtual const char * Read()=0
AllocatedPath
A path name in the native file system character set.
Definition: AllocatedPath.hxx:38
Storage
Definition: StorageInterface.hxx:46
Storage::MapUTF8
virtual gcc_pure std::string MapUTF8(const char *uri_utf8) const =0
Map the given relative URI to an absolute URI.
Storage::MapToRelativeUTF8
virtual gcc_pure const char * MapToRelativeUTF8(const char *uri_utf8) const =0
Check if the given URI points inside this storage.
StorageFileInfo
Definition: FileInfo.hxx:28
StorageDirectoryReader::GetInfo
virtual gcc_pure StorageFileInfo GetInfo(bool follow)=0
Throws #std::runtime_error on error.
Compiler.h
Storage::~Storage
virtual ~Storage()
Definition: StorageInterface.hxx:50
Storage::MapFS
virtual gcc_pure AllocatedPath MapFS(const char *uri_utf8) const
Map the given relative URI to a local file path.
StorageDirectoryReader
Definition: StorageInterface.hxx:31
StorageDirectoryReader::StorageDirectoryReader
StorageDirectoryReader()=default
Storage::GetInfo
virtual gcc_pure StorageFileInfo GetInfo(const char *uri_utf8, bool follow)=0
Throws #std::runtime_error on error.
gcc_pure
#define gcc_pure
Definition: Compiler.h:116
StorageDirectoryReader::~StorageDirectoryReader
virtual ~StorageDirectoryReader()
Definition: StorageInterface.hxx:35