Assimp  v4.1. (December 2018)
Assimp::StreamWriter< SwapEndianess, RuntimeSwitch > Class Template Reference

Wrapper class around IOStream to allow for consistent writing of binary data in both little and big endian format. More...

Public Member Functions

std::size_t GetCurrentPos () const
 
template<typename T >
StreamWriteroperator<< (T f)
 overload operator<< and allow chaining of MM ops. More...
 
void PutF4 (float f)
 Write a float to the stream
More...
 
void PutF8 (double d)
 Write a double to the stream
More...
 
void PutI1 (int8_t n)
 Write a signed 8 bit integer to the stream. More...
 
void PutI2 (int16_t n)
 Write a signed 16 bit integer to the stream. More...
 
void PutI4 (int32_t n)
 Write an signed 32 bit integer to the stream. More...
 
void PutI8 (int64_t n)
 Write a signed 64 bit integer to the stream. More...
 
void PutU1 (uint8_t n)
 Write a unsigned 8 bit integer to the stream. More...
 
void PutU2 (uint16_t n)
 Write a unsigned 16 bit integer to the stream. More...
 
void PutU4 (uint32_t n)
 Write an unsigned 32 bit integer to the stream. More...
 
void PutU8 (uint64_t n)
 Write a unsigned 64 bit integer to the stream. More...
 
void SetCurrentPos (std::size_t new_cursor)
 
 StreamWriter (IOStream *stream, bool le=false)
 
 StreamWriter (std::shared_ptr< IOStream > stream, bool le=false)
 Construction from a given stream with a well-defined endianness. More...
 
 ~StreamWriter ()
 

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 read from a little-endian stream and StreamWriterBE to read from a BE stream. Alternatively, there is StreamWriterAny if the endianness of the output stream is to be determined at runtime.

Constructor & Destructor Documentation

◆ StreamWriter() [1/2]

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.

◆ StreamWriter() [2/2]

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

◆ ~StreamWriter()

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

Member Function Documentation

◆ GetCurrentPos()

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

◆ 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.

◆ 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.

◆ 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.

◆ SetCurrentPos()

template<bool SwapEndianess = false, bool RuntimeSwitch = false>
void Assimp::StreamWriter< SwapEndianess, RuntimeSwitch >::SetCurrentPos ( std::size_t  new_cursor)
inline

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