MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

ProxyInputStream.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_PROXY_INPUT_STREAM_HXX
21 #define MPD_PROXY_INPUT_STREAM_HXX
22
23 #include "InputStream.hxx"
24
25 struct Tag;
26
32 class ProxyInputStream : public InputStream {
33 protected:
34 InputStream &input;
35
36 public:
37 gcc_nonnull_all
38 ProxyInputStream(InputStream *_input);
39
40 virtual ~ProxyInputStream();
41
42 ProxyInputStream(const ProxyInputStream &) = delete;
43 ProxyInputStream &operator=(const ProxyInputStream &) = delete;
44
45 /* virtual methods from InputStream */
46 void Check() override;
47 void Update() override;
48 void Seek(offset_type new_offset) override;
49 bool IsEOF() override;
50 Tag *ReadTag() override;
51 bool IsAvailable() override;
52 size_t Read(void *ptr, size_t read_size) override;
53
54 protected:
61 void CopyAttributes();
62 };
63
64 #endif
ProxyInputStream::Check
void Check() override
Check for errors that may have occurred in the I/O thread.
ProxyInputStream::operator=
ProxyInputStream & operator=(const ProxyInputStream &)=delete
gcc_nonnull_all
#define gcc_nonnull_all
Definition: Compiler.h:122
ProxyInputStream::CopyAttributes
void CopyAttributes()
Copy public attributes from the underlying input stream to the "rewind" input stream.
Tag
The meta information about a song file.
Definition: Tag.hxx:34
InputStream::offset_type
::offset_type offset_type
Definition: InputStream.hxx:38
InputStream
Definition: InputStream.hxx:36
ProxyInputStream::IsEOF
bool IsEOF() override
Returns true if the stream has reached end-of-file.
InputStream.hxx
ProxyInputStream::IsAvailable
bool IsAvailable() override
Returns true if the next read operation will not block: either data is available, or end-of-stream ha...
ProxyInputStream::Update
void Update() override
Update the public attributes.
ProxyInputStream::~ProxyInputStream
virtual ~ProxyInputStream()
ProxyInputStream::ProxyInputStream
gcc_nonnull_all ProxyInputStream(InputStream *_input)
ProxyInputStream
An InputStream that forwards all methods call to another InputStream instance.
Definition: ProxyInputStream.hxx:32
ProxyInputStream::ReadTag
Tag * ReadTag() override
Reads the tag from the stream.
ProxyInputStream::Seek
void Seek(offset_type new_offset) override
Seeks to the specified position in the stream.
ProxyInputStream::input
InputStream & input
Definition: ProxyInputStream.hxx:34
ProxyInputStream::Read
size_t Read(void *ptr, size_t read_size) override
Reads data from the stream into the caller-supplied buffer.