Loading...
Searching...
No Matches
juce_InputStream.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 InputStream
{
public:
virtual ~InputStream() = default;
//==============================================================================
virtual int64 getTotalLength() = 0;
int64 getNumBytesRemaining();
virtual bool isExhausted() = 0;
//==============================================================================
virtual int read (void* destBuffer, int maxBytesToRead) = 0;
ssize_t read (void* destBuffer, size_t maxBytesToRead);
virtual char readByte();
virtual bool readBool();
virtual short readShort();
virtual short readShortBigEndian();
virtual int readInt();
virtual int readIntBigEndian();
virtual int64 readInt64();
virtual int64 readInt64BigEndian();
virtual float readFloat();
virtual float readFloatBigEndian();
virtual double readDouble();
virtual double readDoubleBigEndian();
virtual int readCompressedInt();
//==============================================================================
virtual String readNextLine();
virtual String readString();
virtual String readEntireStreamAsString();
virtual size_t readIntoMemoryBlock (MemoryBlock& destBlock,
ssize_t maxNumBytesToRead = -1);
//==============================================================================
virtual int64 getPosition() = 0;
virtual bool setPosition (int64 newPosition) = 0;
virtual void skipNextBytes (int64 numBytesToSkip);
protected:
//==============================================================================
InputStream() = default;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputStream)
};
} // namespace juce
juce::InputStream::getPosition
virtual int64 getPosition()=0
juce::InputStream::readInt64
virtual int64 readInt64()
Definition juce_InputStream.cpp:133
juce::InputStream::readIntBigEndian
virtual int readIntBigEndian()
Definition juce_InputStream.cpp:98
juce::InputStream::readFloatBigEndian
virtual float readFloatBigEndian()
Definition juce_InputStream.cpp:161
juce::InputStream::~InputStream
virtual ~InputStream()=default
juce::InputStream::getNumBytesRemaining
int64 getNumBytesRemaining()
Definition juce_InputStream.cpp:26
juce::InputStream::readFloat
virtual float readFloat()
Definition juce_InputStream.cpp:153
juce::InputStream::readCompressedInt
virtual int readCompressedInt()
Definition juce_InputStream.cpp:108
juce::InputStream::setPosition
virtual bool setPosition(int64 newPosition)=0
juce::InputStream::isExhausted
virtual bool isExhausted()=0
juce::InputStream::getTotalLength
virtual int64 getTotalLength()=0
juce::InputStream::readDoubleBigEndian
virtual double readDoubleBigEndian()
Definition juce_InputStream.cpp:175
juce::InputStream::readShort
virtual short readShort()
Definition juce_InputStream.cpp:68
juce::InputStream::readInt64BigEndian
virtual int64 readInt64BigEndian()
Definition juce_InputStream.cpp:143
juce::InputStream::skipNextBytes
virtual void skipNextBytes(int64 numBytesToSkip)
Definition juce_InputStream.cpp:237
juce::InputStream::readBool
virtual bool readBool()
Definition juce_InputStream.cpp:63
juce::InputStream::readShortBigEndian
virtual short readShortBigEndian()
Definition juce_InputStream.cpp:78
juce::InputStream::readIntoMemoryBlock
virtual size_t readIntoMemoryBlock(MemoryBlock &destBlock, ssize_t maxNumBytesToRead=-1)
Definition juce_InputStream.cpp:223
juce::InputStream::read
virtual int read(void *destBuffer, int maxBytesToRead)=0
juce::InputStream::readNextLine
virtual String readNextLine()
Definition juce_InputStream.cpp:196
juce::InputStream::readEntireStreamAsString
virtual String readEntireStreamAsString()
Definition juce_InputStream.cpp:229
juce::InputStream::readInt
virtual int readInt()
Definition juce_InputStream.cpp:88
juce::InputStream::readDouble
virtual double readDouble()
Definition juce_InputStream.cpp:168
juce::InputStream::readString
virtual String readString()
Definition juce_InputStream.cpp:182
juce::InputStream::readByte
virtual char readByte()
Definition juce_InputStream.cpp:56
juce::MemoryBlock
Definition juce_MemoryBlock.h:33
juce::String
Definition juce_String.h:53