Debian Codegraph @

modules/lsp-runtime-lib/include/lsp-plug.in/fmt/lspc/ChunkReaderStream.h

raw
1 /*
2 * Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2022 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 21 окт. 2022 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_FMT_LSPC_CHUNKREADERSTREAM_H_
23 #define LSP_PLUG_IN_FMT_LSPC_CHUNKREADERSTREAM_H_
24
25 #include <lsp-plug.in/runtime/version.h>
26 #include <lsp-plug.in/io/IInStream.h>
27
28 namespace lsp
29 {
30 namespace lspc
31 {
32 class ChunkReader;
33
34 class ChunkReaderStream: public io::IInStream
35 {
36 private:
37 ChunkReaderStream & operator = (const ChunkReaderStream &);
38
39 private:
40 ChunkReader *pReader;
41 bool bDelete;
42
43 private:
44 void do_close();
45
46 public:
47 ChunkReaderStream(ChunkReader *reader, bool free = false);
48 virtual ~ChunkReaderStream();
49
50 public:
51 virtual wssize_t position() override;
52 virtual ssize_t read_byte() override;
53 virtual ssize_t read(void *dst, size_t count) override;
54 virtual wssize_t skip(wsize_t amount) override;
55 virtual status_t close() override;
56 };
57
58 } /* namespace lspc */
59 } /* namespace lsp */
60
61 // Definition of lsp::lspc::ChunkReader
62 #include <lsp-plug.in/fmt/lspc/ChunkReader.h>
63
64
65 #endif /* LSP_PLUG_IN_FMT_LSPC_CHUNKREADERSTREAM_H_ */