Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::BinaryFileInputStream Class Reference

#include <BinaryFileInputStream.h>

Inheritance diagram for ph::BinaryFileInputStream:
ph::StdInputStream ph::IInputStream ph::IDataStream

Public Member Functions

 BinaryFileInputStream ()=default
 
 BinaryFileInputStream (const Path &filePath)
 
 BinaryFileInputStream (BinaryFileInputStream &&other)=default
 
template<typename T , bool DO_BYTE_REVERSAL = false>
void readData (T *out_data)
 
template<typename T , bool DO_BYTE_REVERSAL = false>
void readData (TSpan< T > out_data)
 
std::optional< std::size_t > getFileSizeInBytes () const
 
BinaryFileInputStreamoperator= (BinaryFileInputStream &&rhs)=default
 
- Public Member Functions inherited from ph::StdInputStream
 StdInputStream ()=default
 
 StdInputStream (std::unique_ptr< std::istream > stream)
 
 StdInputStream (StdInputStream &&other) noexcept
 
void read (std::size_t numBytes, std::byte *out_bytes) override
 Read specific number of raw bytes in one go. The method does not return before finishing the reading process.
 
void readString (std::string *out_string, char delimiter) override
 Read a string in one go. Note the EOF is also considered a delimiter (the final one).
 
void seekGet (std::size_t pos) override
 Set the input position of the stream. The unit of the position is defined by the implementation.
 
std::optional< std::size_t > tellGet () override
 Get the current input position of the stream. The unit of the position is defined by the implementation.
 
 operator bool () const override
 
std::size_t readSome (std::size_t numBytes, std::byte *out_bytes) override
 Read some data in the form of raw bytes. The method may return before finish reading all bytes. In such case, the method returns how many bytes were actually read.
 
std::istream * getStream () const
 
StdInputStreamoperator= (StdInputStream &&rhs) noexcept
 
- Public Member Functions inherited from ph::IInputStream
void readLine (std::string *out_string)
 Read a line. Equivalent to calling readString(std::string*, char) with '
' as the delimiter.
 
- Public Member Functions inherited from ph::IDataStream
virtual ~IDataStream ()=default
 
virtual std::string acquireName () const
 Access to the stream's name. This method is not meant to be used in a high performance context, unless otherwise stated by the overridder. Stream name is not always available.
 

Additional Inherited Members

- Protected Member Functions inherited from ph::StdInputStream
bool isStreamGoodForRead () const
 
void ensureStreamIsGoodForRead () const
 Check if the stream has any error.
 
std::string getReasonForError () const
 A description for why the stream is not in a good state.
 

Constructor & Destructor Documentation

◆ BinaryFileInputStream() [1/3]

ph::BinaryFileInputStream::BinaryFileInputStream ( )
inlinedefault

◆ BinaryFileInputStream() [2/3]

ph::BinaryFileInputStream::BinaryFileInputStream ( const Path & filePath)
explicit

◆ BinaryFileInputStream() [3/3]

ph::BinaryFileInputStream::BinaryFileInputStream ( BinaryFileInputStream && other)
inlinedefault

Member Function Documentation

◆ getFileSizeInBytes()

std::optional< std::size_t > ph::BinaryFileInputStream::getFileSizeInBytes ( ) const

◆ operator=()

BinaryFileInputStream & ph::BinaryFileInputStream::operator= ( BinaryFileInputStream && rhs)
inlinedefault

◆ readData() [1/2]

template<typename T , bool DO_BYTE_REVERSAL>
void ph::BinaryFileInputStream::readData ( T * out_data)
inline

◆ readData() [2/2]

template<typename T , bool DO_BYTE_REVERSAL>
void ph::BinaryFileInputStream::readData ( TSpan< T > out_data)
inline

The documentation for this class was generated from the following files: