Path Tracer
Public Member Functions | List of all members
Assimp::StreamWriter< SwapEndianess, RuntimeSwitch > Class Template Reference

#include <StreamWriter.h>

Public Member Functions

 StreamWriter (std::shared_ptr< IOStream > stream, bool le=false)
 
 StreamWriter (IOStream *stream, bool le=false)
 
void Flush ()
 
aiReturn Seek (size_t pOffset, aiOrigin pOrigin=aiOrigin_SET)
 
size_t Tell ()
 
void PutF4 (float f)
 
void PutF8 (double d)
 
void PutI2 (int16_t n)
 
void PutI1 (int8_t n)
 
void PutI4 (int32_t n)
 
void PutI8 (int64_t n)
 
void PutU2 (uint16_t n)
 
void PutU1 (uint8_t n)
 
void PutU4 (uint32_t n)
 
void PutU8 (uint64_t n)
 
void PutChar (char c)
 
void PutString (const aiString &s)
 
void PutString (const std::string &s)
 
template<typename T >
StreamWriteroperator<< (T f)
 
std::size_t GetCurrentPos () const
 
void SetCurrentPos (std::size_t new_cursor)
 
template<typename T >
void Put (T f)
 

Detailed Description

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
class Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >

Wrapper class around IOStream to allow for consistent writing of binary data in both little and big endian format. Don't attempt to instance the template directly. Use StreamWriterLE to write to a little-endian stream and StreamWriterBE to write to a BE stream. Alternatively, there is StreamWriterAny if the endianness of the output stream is to be determined at runtime.

Constructor & Destructor Documentation

◆ StreamWriter()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::StreamWriter ( std::shared_ptr< IOStream stream,
bool  le = false 
)
inline

Construction from a given stream with a well-defined endianness.

The StreamReader holds a permanent strong reference to the stream, which is released upon destruction.

Parameters
streamInput stream. The stream is not re-seeked and writing continues at the current position of the stream cursor.
leIf RuntimeSwitch is true: specifies whether the stream is in little endian byte order. Otherwise the endianness information is defined by the SwapEndianess template parameter and this parameter is meaningless.

Member Function Documentation

◆ Flush()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::Flush ( )
inline

Flush the contents of the internal buffer, and the output IOStream

◆ operator<<()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
template<typename T >
StreamWriter& Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::operator<< ( f)
inline

overload operator<< and allow chaining of MM ops.

◆ Put()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
template<typename T >
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::Put ( f)
inline

Generic write method. ByteSwap::Swap(T*) must be defined

◆ PutChar()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutChar ( char  c)
inline

Write a single character to the stream

◆ PutF4()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutF4 ( float  f)
inline

Write a float to the stream

◆ PutF8()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutF8 ( double  d)
inline

Write a double to the stream

◆ PutI1()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutI1 ( int8_t  n)
inline

Write a signed 8 bit integer to the stream

◆ PutI2()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutI2 ( int16_t  n)
inline

Write a signed 16 bit integer to the stream

◆ PutI4()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutI4 ( int32_t  n)
inline

Write an signed 32 bit integer to the stream

◆ PutI8()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutI8 ( int64_t  n)
inline

Write a signed 64 bit integer to the stream

◆ PutString() [1/2]

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutString ( const aiString s)
inline

Write an aiString to the stream

◆ PutString() [2/2]

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutString ( const std::string &  s)
inline

Write a std::string to the stream

◆ PutU1()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutU1 ( uint8_t  n)
inline

Write a unsigned 8 bit integer to the stream

◆ PutU2()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutU2 ( uint16_t  n)
inline

Write a unsigned 16 bit integer to the stream

◆ PutU4()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutU4 ( uint32_t  n)
inline

Write an unsigned 32 bit integer to the stream

◆ PutU8()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::PutU8 ( uint64_t  n)
inline

Write a unsigned 64 bit integer to the stream

◆ Seek()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
aiReturn Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::Seek ( size_t  pOffset,
aiOrigin  pOrigin = aiOrigin_SET 
)
inline

Seek to the given offset / origin in the output IOStream.

Flushes the internal buffer and the output IOStream prior to seeking.

◆ Tell()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
size_t Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::Tell ( )
inline

Tell the current position in the output IOStream.

First flushes the internal buffer and the output IOStream.


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