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