Loading...
Searching...
No Matches
juce_OutputStream.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API OutputStream
{
protected:
//==============================================================================
OutputStream();
public:
virtual ~OutputStream();
//==============================================================================
virtual void flush() = 0;
virtual bool setPosition (int64 newPosition) = 0;
virtual int64 getPosition() = 0;
//==============================================================================
virtual bool write (const void* dataToWrite,
size_t numberOfBytes) = 0;
//==============================================================================
virtual bool writeByte (char byte);
virtual bool writeBool (bool boolValue);
virtual bool writeShort (short value);
virtual bool writeShortBigEndian (short value);
virtual bool writeInt (int value);
virtual bool writeIntBigEndian (int value);
virtual bool writeInt64 (int64 value);
virtual bool writeInt64BigEndian (int64 value);
virtual bool writeFloat (float value);
virtual bool writeFloatBigEndian (float value);
virtual bool writeDouble (double value);
virtual bool writeDoubleBigEndian (double value);
virtual bool writeRepeatedByte (uint8 byte, size_t numTimesToRepeat);
virtual bool writeCompressedInt (int value);
virtual bool writeString (const String& text);
virtual bool writeText (const String& text,
bool asUTF16,
bool writeUTF16ByteOrderMark,
const char* lineEndings);
virtual int64 writeFromInputStream (InputStream& source, int64 maxNumBytesToWrite);
//==============================================================================
void setNewLineString (const String& newLineString);
const String& getNewLineString() const noexcept { return newLineString; }
private:
//==============================================================================
String newLineString;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OutputStream)
};
//==============================================================================
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, int number);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, int64 number);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, double number);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, char character);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const char* text);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const MemoryBlock& data);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const File& fileToRead);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, InputStream& streamToRead);
JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const NewLine&);
} // namespace juce
juce::InputStream
Definition juce_InputStream.h:37
juce::OutputStream
Definition juce_OutputStream.h:38
juce::OutputStream::writeDoubleBigEndian
virtual bool writeDoubleBigEndian(double value)
Definition juce_OutputStream.cpp:176
juce::OutputStream::writeDouble
virtual bool writeDouble(double value)
Definition juce_OutputStream.cpp:169
juce::OutputStream::write
virtual bool write(const void *dataToWrite, size_t numberOfBytes)=0
juce::OutputStream::writeRepeatedByte
virtual bool writeRepeatedByte(uint8 byte, size_t numTimesToRepeat)
Definition juce_OutputStream.cpp:88
juce::OutputStream::setNewLineString
void setNewLineString(const String &newLineString)
Definition juce_OutputStream.cpp:321
juce::OutputStream::writeInt64BigEndian
virtual bool writeInt64BigEndian(int64 value)
Definition juce_OutputStream.cpp:149
juce::OutputStream::getPosition
virtual int64 getPosition()=0
juce::OutputStream::writeFloat
virtual bool writeFloat(float value)
Definition juce_OutputStream.cpp:155
juce::OutputStream::writeFromInputStream
virtual int64 writeFromInputStream(InputStream &source, int64 maxNumBytesToWrite)
Definition juce_OutputStream.cpp:296
juce::OutputStream::writeText
virtual bool writeText(const String &text, bool asUTF16, bool writeUTF16ByteOrderMark, const char *lineEndings)
Definition juce_OutputStream.cpp:198
juce::OutputStream::writeCompressedInt
virtual bool writeCompressedInt(int value)
Definition juce_OutputStream.cpp:121
juce::OutputStream::writeByte
virtual bool writeByte(char byte)
Definition juce_OutputStream.cpp:83
juce::OutputStream::writeShort
virtual bool writeShort(short value)
Definition juce_OutputStream.cpp:97
juce::OutputStream::writeBool
virtual bool writeBool(bool boolValue)
Definition juce_OutputStream.cpp:77
juce::OutputStream::writeInt64
virtual bool writeInt64(int64 value)
Definition juce_OutputStream.cpp:143
juce::OutputStream::writeIntBigEndian
virtual bool writeIntBigEndian(int value)
Definition juce_OutputStream.cpp:115
juce::OutputStream::setPosition
virtual bool setPosition(int64 newPosition)=0
juce::OutputStream::writeShortBigEndian
virtual bool writeShortBigEndian(short value)
Definition juce_OutputStream.cpp:103
juce::OutputStream::flush
virtual void flush()=0
juce::OutputStream::writeFloatBigEndian
virtual bool writeFloatBigEndian(float value)
Definition juce_OutputStream.cpp:162
juce::OutputStream::writeInt
virtual bool writeInt(int value)
Definition juce_OutputStream.cpp:109
juce::OutputStream::getNewLineString
const String & getNewLineString() const noexcept
Definition juce_OutputStream.h:231
juce::OutputStream::writeString
virtual bool writeString(const String &text)
Definition juce_OutputStream.cpp:183
juce::String
Definition juce_String.h:53