Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic librevenge::RVNGInputStream: More...
#include <STOFFInputStream.hxx>
| Public Member Functions | |
| STOFFInputStream (std::shared_ptr< librevenge::RVNGInputStream > input, bool inverted) | |
| creates a stream with given endian | |
| STOFFInputStream (librevenge::RVNGInputStream *input, bool inverted) | |
| creates a stream with given endian from an existing input | |
| ~STOFFInputStream () | |
| destructor | |
| std::shared_ptr< librevenge::RVNGInputStream > | input () | 
| returns the basic librevenge::RVNGInputStream | |
| bool | readInverted () const | 
| returns the endian mode (see constructor) | |
| void | setReadInverted (bool newVal) | 
| sets the endian mode | |
| int | seek (long offset, librevenge::RVNG_SEEK_TYPE seekType) | 
| seeks to a offset position, from actual, beginning or ending position | |
| long | tell () | 
| returns actual offset position | |
| long | size () const | 
| returns the stream size | |
| bool | checkPosition (long pos) const | 
| checks if a position is or not a valid file position | |
| bool | isEnd () | 
| returns true if we are at the end of the section/file | |
| int | peek () | 
| returns the value of the next caracters or -1, but does not increment the position counter | |
| STOFFInputStream & | operator>> (bool &res) | 
| operator>> for bool | |
| STOFFInputStream & | operator>> (uint8_t &res) | 
| operator>> for uint8_t | |
| STOFFInputStream & | operator>> (int8_t &res) | 
| operator>> for int8_t | |
| STOFFInputStream & | operator>> (uint16_t &res) | 
| operator>> for uint16_t | |
| STOFFInputStream & | operator>> (int16_t &res) | 
| operator>> for int16_t | |
| STOFFInputStream & | operator>> (uint32_t &res) | 
| operator>> for uint32_t | |
| STOFFInputStream & | operator>> (int32_t &res) | 
| operator>> for int32_t | |
| STOFFInputStream & | operator>> (double &res) | 
| operator>> for double | |
| unsigned long | readULong (int num) | 
| returns a uint8, uint16, uint32 readed from actualPos | |
| long | readLong (int num) | 
| return a int8, int16, int32 readed from actualPos | |
| bool | readColor (STOFFColor &color) | 
| try to read a color | |
| bool | readCompressedLong (long &res) | 
| read a compressed long (pstm.cxx:ReadCompressed) | |
| bool | readCompressedULong (unsigned long &res) | 
| read a compressed unsigned long (sw_sw3imp.cxx Sw3IoImp::InULong) | |
| bool | readDouble8 (double &res, bool &isNotANumber) | 
| try to read a double of size 8: 1.5 bytes exponent, 6.5 bytes mantisse | |
| bool | readDoubleReverted8 (double &res, bool &isNotANumber) | 
| try to read a double of size 8: 6.5 bytes mantisse, 1.5 bytes exponent | |
| bool | readDouble10 (double &res, bool &isNotANumber) | 
| try to read a double of size 10: 2 bytes exponent, 8 bytes mantisse | |
| const uint8_t * | read (size_t numBytes, unsigned long &numBytesRead) | 
| ! | |
| bool | readDataBlock (long size, librevenge::RVNGBinaryData &data) | 
| reads a librevenge::RVNGBinaryData with a given size in the actual section/file | |
| bool | readEndDataBlock (librevenge::RVNGBinaryData &data) | 
| reads a librevenge::RVNGBinaryData from actPos to the end of the section/file | |
| bool | isStructured () | 
| return true if the stream is ole | |
| unsigned | subStreamCount () | 
| returns the number of substream | |
| std::string | subStreamName (unsigned id) | 
| returns the name of the i^th substream | |
| std::shared_ptr< STOFFInputStream > | getSubStreamByName (std::string const &name) | 
| return a new stream for a ole zone | |
| std::shared_ptr< STOFFInputStream > | getSubStreamById (unsigned id) | 
| return a new stream for a ole zone | |
| bool | hasDataFork () const | 
| returns true if the data fork block exists | |
| Static Public Member Functions | |
| static std::shared_ptr< STOFFInputStream > | get (librevenge::RVNGBinaryData const &data, bool inverted) | 
| returns a new input stream corresponding to a librevenge::RVNGBinaryData | |
| static unsigned long | readULong (librevenge::RVNGInputStream *stream, int num, unsigned long a, bool inverseRead) | 
| internal function used to read num byte, | |
| Protected Member Functions | |
| void | updateStreamSize () | 
| update the stream size ( must be called in the constructor ) | |
| Static Protected Member Functions | |
| static uint8_t | readU8 (librevenge::RVNGInputStream *stream) | 
| internal function used to read a byte | |
| Protected Attributes | |
| std::shared_ptr< librevenge::RVNGInputStream > | m_stream | 
| the initial input | |
| long | m_streamSize | 
| the stream size | |
| bool | m_inverseRead | 
| big or normal endian | |
| Private Member Functions | |
| STOFFInputStream (STOFFInputStream const &orig) | |
| STOFFInputStream & | operator= (STOFFInputStream const &orig) | 
Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic librevenge::RVNGInputStream:
| STOFFInputStream::STOFFInputStream | ( | std::shared_ptr< librevenge::RVNGInputStream > | input, | 
| bool | inverted ) | 
creates a stream with given endian
| input | the given input | 
| inverted | must be set to true for pc doc and ole part and to false for mac doc | 
Referenced by get(), getSubStreamById(), getSubStreamByName(), operator=(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), and STOFFInputStream().
| STOFFInputStream::STOFFInputStream | ( | librevenge::RVNGInputStream * | input, | 
| bool | inverted ) | 
creates a stream with given endian from an existing input
Note: this functions does not delete input
| STOFFInputStream::~STOFFInputStream | ( | ) | 
destructor
| 
 | private | 
| 
 | inline | 
checks if a position is or not a valid file position
Referenced by readColor().
| 
 | static | 
returns a new input stream corresponding to a librevenge::RVNGBinaryData
| std::shared_ptr< STOFFInputStream > STOFFInputStream::getSubStreamById | ( | unsigned | id | ) | 
return a new stream for a ole zone
| std::shared_ptr< STOFFInputStream > STOFFInputStream::getSubStreamByName | ( | std::string const & | name | ) | 
return a new stream for a ole zone
| 
 | inline | 
returns true if the data fork block exists
Referenced by isEnd(), read(), readDataBlock(), readEndDataBlock(), seek(), and tell().
| 
 | inline | 
returns the basic librevenge::RVNGInputStream
| bool STOFFInputStream::isEnd | ( | ) | 
returns true if we are at the end of the section/file
Referenced by peek().
| bool STOFFInputStream::isStructured | ( | ) | 
return true if the stream is ole
| 
 | private | 
| 
 | inline | 
operator>> for bool
| 
 | inline | 
operator>> for double
| 
 | inline | 
operator>> for int16_t
| 
 | inline | 
operator>> for int32_t
| 
 | inline | 
operator>> for int8_t
| 
 | inline | 
operator>> for uint16_t
| 
 | inline | 
operator>> for uint32_t
| 
 | inline | 
operator>> for uint8_t
| int STOFFInputStream::peek | ( | ) | 
returns the value of the next caracters or -1, but does not increment the position counter
| const uint8_t * STOFFInputStream::read | ( | size_t | numBytes, | 
| unsigned long & | numBytesRead ) | 
!
reads numbytes data, WITHOUT using any endian or section consideration
| bool STOFFInputStream::readColor | ( | STOFFColor & | color | ) | 
try to read a color
| bool STOFFInputStream::readCompressedLong | ( | long & | res | ) | 
read a compressed long (pstm.cxx:ReadCompressed)
| bool STOFFInputStream::readCompressedULong | ( | unsigned long & | res | ) | 
read a compressed unsigned long (sw_sw3imp.cxx Sw3IoImp::InULong)
| bool STOFFInputStream::readDataBlock | ( | long | size, | 
| librevenge::RVNGBinaryData & | data ) | 
reads a librevenge::RVNGBinaryData with a given size in the actual section/file
Referenced by readEndDataBlock().
| bool STOFFInputStream::readDouble10 | ( | double & | res, | 
| bool & | isNotANumber ) | 
try to read a double of size 10: 2 bytes exponent, 8 bytes mantisse
| bool STOFFInputStream::readDouble8 | ( | double & | res, | 
| bool & | isNotANumber ) | 
try to read a double of size 8: 1.5 bytes exponent, 6.5 bytes mantisse
| bool STOFFInputStream::readDoubleReverted8 | ( | double & | res, | 
| bool & | isNotANumber ) | 
try to read a double of size 8: 6.5 bytes mantisse, 1.5 bytes exponent
Referenced by operator>>().
| bool STOFFInputStream::readEndDataBlock | ( | librevenge::RVNGBinaryData & | data | ) | 
reads a librevenge::RVNGBinaryData from actPos to the end of the section/file
| 
 | inline | 
returns the endian mode (see constructor)
| long STOFFInputStream::readLong | ( | int | num | ) | 
return a int8, int16, int32 readed from actualPos
Referenced by operator>>(), operator>>(), and operator>>().
| 
 | staticprotected | 
internal function used to read a byte
Referenced by readULong().
| 
 | inline | 
returns a uint8, uint16, uint32 readed from actualPos
Referenced by operator>>(), operator>>(), operator>>(), operator>>(), peek(), readColor(), readCompressedLong(), readCompressedULong(), readDouble10(), readDouble8(), readDoubleReverted8(), readLong(), readULong(), and readULong().
| 
 | static | 
internal function used to read num byte,
| int STOFFInputStream::seek | ( | long | offset, | 
| librevenge::RVNG_SEEK_TYPE | seekType ) | 
seeks to a offset position, from actual, beginning or ending position
Referenced by getSubStreamById(), getSubStreamByName(), operator>>(), peek(), readDouble10(), and STOFFInputStream().
| 
 | inline | 
sets the endian mode
| 
 | inline | 
returns the stream size
Referenced by isEnd(), readDataBlock(), readEndDataBlock(), and seek().
| unsigned STOFFInputStream::subStreamCount | ( | ) | 
returns the number of substream
| std::string STOFFInputStream::subStreamName | ( | unsigned | id | ) | 
returns the name of the i^th substream
| long STOFFInputStream::tell | ( | ) | 
returns actual offset position
Referenced by getSubStreamById(), getSubStreamByName(), operator>>(), readColor(), readCompressedLong(), readDataBlock(), readDouble10(), readDouble8(), readDoubleReverted8(), readEndDataBlock(), seek(), and updateStreamSize().
| 
 | protected | 
update the stream size ( must be called in the constructor )
Referenced by STOFFInputStream(), and STOFFInputStream().
| 
 | protected | 
big or normal endian
Referenced by getSubStreamById(), getSubStreamByName(), readInverted(), readULong(), setReadInverted(), STOFFInputStream(), and STOFFInputStream().
| 
 | protected | 
the initial input
Referenced by getSubStreamById(), getSubStreamByName(), hasDataFork(), input(), isEnd(), isStructured(), read(), readColor(), readCompressedLong(), readCompressedULong(), readDataBlock(), readDouble10(), readDouble8(), readDoubleReverted8(), readULong(), seek(), STOFFInputStream(), STOFFInputStream(), subStreamCount(), subStreamName(), tell(), and updateStreamSize().
| 
 | protected | 
the stream size
Referenced by checkPosition(), readCompressedLong(), readDouble10(), readDouble8(), readDoubleReverted8(), seek(), size(), STOFFInputStream(), STOFFInputStream(), and updateStreamSize().