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_OutputStream.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//==============================================================================
37class JUCE_API OutputStream
38{
39protected:
40 //==============================================================================
42
43public:
49 virtual ~OutputStream();
50
51 //==============================================================================
54 virtual void flush() = 0;
55
63 virtual bool setPosition (int64 newPosition) = 0;
64
69 virtual int64 getPosition() = 0;
70
71 //==============================================================================
82 virtual bool write (const void* dataToWrite,
83 size_t numberOfBytes) = 0;
84
85 //==============================================================================
90 virtual bool writeByte (char byte);
91
97 virtual bool writeBool (bool boolValue);
98
104 virtual bool writeShort (short value);
105
111 virtual bool writeShortBigEndian (short value);
112
117 virtual bool writeInt (int value);
118
123 virtual bool writeIntBigEndian (int value);
124
129 virtual bool writeInt64 (int64 value);
130
135 virtual bool writeInt64BigEndian (int64 value);
136
142 virtual bool writeFloat (float value);
143
149 virtual bool writeFloatBigEndian (float value);
150
156 virtual bool writeDouble (double value);
157
163 virtual bool writeDoubleBigEndian (double value);
164
168 virtual bool writeRepeatedByte (uint8 byte, size_t numTimesToRepeat);
169
181 virtual bool writeCompressedInt (int value);
182
196 virtual bool writeString (const String& text);
197
209 virtual bool writeText (const String& text,
210 bool asUTF16,
211 bool writeUTF16ByteOrderMark,
212 const char* lineEndings);
213
222 virtual int64 writeFromInputStream (InputStream& source, int64 maxNumBytesToWrite);
223
224 //==============================================================================
228 void setNewLineString (const String& newLineString);
229
231 const String& getNewLineString() const noexcept { return newLineString; }
232
233private:
234 //==============================================================================
235 String newLineString;
236
238};
239
240//==============================================================================
242JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, int number);
243
245JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, int64 number);
246
248JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, double number);
249
251JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, char character);
252
254JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const char* text);
255
257JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryBlock& data);
258
260JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const File& fileToRead);
261
263JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, InputStream& streamToRead);
264
272JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const NewLine&);
273
274} // namespace juce
The base class for streams that read data.
The base class for streams that write data to some kind of destination.
virtual bool write(const void *dataToWrite, size_t numberOfBytes)=0
Writes a block of data to the stream.
virtual int64 getPosition()=0
Returns the stream's current position.
virtual bool setPosition(int64 newPosition)=0
Tries to move the stream's output position.
virtual void flush()=0
If the stream is using a buffer, this will ensure it gets written out to the destination.
const String & getNewLineString() const noexcept
Returns the current new-line string that was set by setNewLineString().
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 ...
#define JUCE_CALLTYPE
This macro defines the C calling convention used as the standard for JUCE calls.
JUCE Namespace.
OutputStream &JUCE_CALLTYPE operator<<(OutputStream &stream, const BigInteger &value)
Writes a BigInteger to an OutputStream as a UTF8 decimal string.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
long long int64
A platform-independent 64-bit integer type.