JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_InputStream.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
36class JUCE_API InputStream
37{
38public:
40 virtual ~InputStream() = default;
41
42 //==============================================================================
52 virtual int64 getTotalLength() = 0;
53
58 int64 getNumBytesRemaining();
59
61 virtual bool isExhausted() = 0;
62
63 //==============================================================================
78 virtual int read (void* destBuffer, int maxBytesToRead) = 0;
79
80 ssize_t read (void* destBuffer, size_t maxBytesToRead);
81
86 virtual char readByte();
87
93 virtual bool readBool();
94
100 virtual short readShort();
101
107 virtual short readShortBigEndian();
108
118 virtual int readInt();
119
129 virtual int readIntBigEndian();
130
140 virtual int64 readInt64();
141
151 virtual int64 readInt64BigEndian();
152
158 virtual float readFloat();
159
165 virtual float readFloatBigEndian();
166
172 virtual double readDouble();
173
179 virtual double readDoubleBigEndian();
180
186 virtual int readCompressedInt();
187
188 //==============================================================================
197 virtual String readNextLine();
198
206 virtual String readString();
207
213 virtual String readEntireStreamAsString();
214
223 virtual size_t readIntoMemoryBlock (MemoryBlock& destBlock,
224 ssize_t maxNumBytesToRead = -1);
225
226 //==============================================================================
230 virtual int64 getPosition() = 0;
231
244 virtual bool setPosition (int64 newPosition) = 0;
245
253 virtual void skipNextBytes (int64 numBytesToSkip);
254
255
256protected:
257 //==============================================================================
258 InputStream() = default;
259
260private:
262};
263
264} // namespace juce
The base class for streams that read data.
virtual int64 getPosition()=0
Returns the offset of the next byte that will be read from the stream.
virtual ~InputStream()=default
Destructor.
virtual bool setPosition(int64 newPosition)=0
Tries to move the current read position of the stream.
virtual bool isExhausted()=0
Returns true if the stream has no more data to read.
virtual int64 getTotalLength()=0
Returns the total number of bytes available for reading in this stream.
virtual int read(void *destBuffer, int maxBytesToRead)=0
Reads some data from the stream into a memory buffer.
A class to hold a resizable block of raw data.
The JUCE String class!
Definition juce_String.h:53
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.
long long int64
A platform-independent 64-bit integer type.
read
typedef ssize_t