2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2008-12-16 21:42:34 +01:00
|
|
|
|
2013-01-29 23:26:51 +01:00
|
|
|
#ifndef MPD_ARCHIVE_FILE_HXX
|
|
|
|
#define MPD_ARCHIVE_FILE_HXX
|
2008-12-16 21:42:34 +01:00
|
|
|
|
2017-12-26 20:05:22 +01:00
|
|
|
#include "input/Ptr.hxx"
|
2019-05-07 19:23:01 +02:00
|
|
|
#include "thread/Mutex.hxx"
|
2017-12-26 20:05:22 +01:00
|
|
|
|
2013-11-28 11:50:54 +01:00
|
|
|
class ArchiveVisitor;
|
2013-08-10 18:02:44 +02:00
|
|
|
|
2013-01-29 23:26:51 +01:00
|
|
|
class ArchiveFile {
|
2013-01-29 23:36:58 +01:00
|
|
|
public:
|
2017-12-22 16:30:17 +01:00
|
|
|
virtual ~ArchiveFile() noexcept = default;
|
2013-01-29 23:36:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Visit all entries inside this archive.
|
|
|
|
*/
|
|
|
|
virtual void Visit(ArchiveVisitor &visitor) = 0;
|
|
|
|
|
|
|
|
/**
|
2013-10-23 22:08:59 +02:00
|
|
|
* Opens an InputStream of a file within the archive.
|
2013-01-29 23:36:58 +01:00
|
|
|
*
|
2016-09-09 15:37:06 +02:00
|
|
|
* Throws std::runtime_error on error.
|
|
|
|
*
|
2013-01-29 23:36:58 +01:00
|
|
|
* @param path the path within the archive
|
|
|
|
*/
|
2017-12-26 20:05:22 +01:00
|
|
|
virtual InputStreamPtr OpenStream(const char *path,
|
2018-06-22 19:37:18 +02:00
|
|
|
Mutex &mutex) = 0;
|
2013-01-29 23:26:51 +01:00
|
|
|
};
|
2009-12-16 16:28:26 +01:00
|
|
|
|
2008-12-16 21:42:34 +01:00
|
|
|
#endif
|