Go to the documentation of this file.
27 #ifndef WPSOLESTREAM_H
28 #define WPSOLESTREAM_H
35 class RVNGInputStream;
43 #endif // WPSOLESTREAM_H
librevenge::RVNGInputStream * m_input
Definition: WPSOLEStream.cpp:478
@ Avail
Definition: WPSOLEStream.cpp:70
@ End
Definition: WPSOLEStream.cpp:246
DirTree & operator=(const DirTree &)
~WPSOLEStream() final
destructor
Definition: WPSOLEStream.cpp:1784
bool m_valid
Definition: WPSOLEStream.cpp:286
bool createOleFromDirectory(IStorage *io, std::string const &name)
create the data corresponding to a directory
Definition: WPSOLEStream.cpp:1651
std::string m_name
Definition: WPSOLEStream.cpp:698
unsigned long m_size
the stream size
Definition: WPSOLEStream.cpp:697
DirInfo()
constructor
Definition: WPSOLEStream.cpp:222
int seek(long, librevenge::RVNG_SEEK_TYPE) final
seeks to a offset position, from actual, beginning or ending position
Definition: WPSOLEStream.cpp:1803
void load(unsigned char *buffer, unsigned len)
tries to read the different entries
Definition: WPSOLEStream.cpp:1020
Header m_header
Definition: WPSOLEStream.cpp:676
bool existsSubStream(const char *name) final
returns true if a substream with name exists
Definition: WPSOLEStream.cpp:1831
DirInfo m_info
first child
Definition: WPSOLEStream.cpp:296
unsigned index(const std::string &name, bool create=false)
given a fullname (e.g "/ObjectPool/_1020961869"), find the entry
Definition: WPSOLEStream.cpp:961
bool getFileData(std::vector< unsigned char > &data)
try to return in data the contain of the file
Definition: WPSOLEStream.cpp:598
DirTree m_dirtree
Definition: WPSOLEStream.cpp:677
IStream & operator=(const IStream &)
std::vector< unsigned > get_siblings(unsigned ind) const
returns a list of siblings corresponding to a node
Definition: WPSOLEStream.cpp:396
std::vector< DirEntry > m_entries
Definition: WPSOLEStream.cpp:467
Result m_result
Definition: WPSOLEStream.cpp:479
unsigned m_time[4]
four uint32_t : the first two used for creation, the last for modification time
Definition: WPSOLEStream.cpp:238
std::vector< unsigned char > m_data
Definition: WPSOLEStream.cpp:685
AllocTable m_bbat
Definition: WPSOLEStream.cpp:483
Definition: WPSOLEStream.cpp:64
static unsigned long getMaximumSize(bool isBig)
returns the maximum size of a big/small block
Definition: WPSOLEStream.cpp:623
@ Ok
Definition: WPSOLEStream.cpp:476
AllocTable m_bbat
Definition: WPSOLEStream.cpp:678
unsigned m_type
true if this is a classic mac directory entry
Definition: WPSOLEStream.cpp:288
unsigned long m_size
the red/black color: 0 means red
Definition: WPSOLEStream.cpp:290
@ Eof
Definition: WPSOLEStream.cpp:70
void clear()
clear all entries, leaving only a root entries
Definition: WPSOLEStream.cpp:936
RVNGInputStreamPtr getOLEInputStream(RVNGInputStreamPtr input)
Definition: WPSOLEStream.cpp:1881
@ BadOLE
Definition: WPSOLEStream.cpp:476
unsigned index(const std::string &name)
returns a directory entry corresponding to a index
Definition: WPSOLEStream.cpp:505
std::vector< std::string > getSubStreamNamesList()
Definition: WPSOLEStream.cpp:1162
std::vector< unsigned char > m_data
Definition: WPSOLEStream.cpp:744
std::string name() const
returns the simplified file name
Definition: WPSOLEStream.cpp:258
static unsigned short readU16(const unsigned char *ptr)
Definition: WPSOLEStream.cpp:72
unsigned m_blockSize
Definition: WPSOLEStream.cpp:161
void resize(unsigned long newsize)
Definition: WPSOLEStream.cpp:171
unsigned long size() const
Definition: WPSOLEStream.cpp:704
void setRootType(bool pc)
set the root to a mac/pc root */
Definition: WPSOLEStream.cpp:578
bool use_big_block_for(unsigned long size) const
Definition: WPSOLEStream.cpp:534
DirEntry * entry(unsigned ind)
returns the entry with a given index
Definition: WPSOLEStream.cpp:330
OStorage & operator=(const OStorage &)
const std::string & filename() const
returns the string which was store inside the file.
Definition: WPSOLEStream.cpp:267
librevenge::RVNGInputStream * getSubStreamById(unsigned id) final
return a new stream for a ole zone
Definition: WPSOLEStream.cpp:1843
unsigned m_clsid[4]
four uint32_t: the clsid data
Definition: WPSOLEStream.cpp:240
void setInformation(std::string const &name, DirInfo const &info)
set a node information
Definition: WPSOLEStream.cpp:587
unsigned newSBlock()
create a new small block, ... and returns is identifier
Definition: WPSOLEStream.cpp:645
AllocTable m_sbat
Definition: WPSOLEStream.cpp:484
IStorage(librevenge::RVNGInputStream *is)
Definition: WPSOLEStream.cpp:1145
DirEntry * entry(unsigned ind)
returns a directory entry corresponding to a index
Definition: WPSOLEStream.cpp:492
unsigned setInRBTForm(std::vector< unsigned > const &childList, unsigned firstInd, unsigned lastInd, unsigned height)
rebuild all the childs m_left, m_right index as a red black tree, returns the root index.
Definition: WPSOLEStream.cpp:1110
std::vector< unsigned long > m_blocks
Definition: WPSOLEStream.cpp:734
unsigned count() const
returns the number of entries
Definition: WPSOLEStream.cpp:319
bool isStructured() final
returns true if the stream is ole
Definition: WPSOLEStream.cpp:1814
void setRootType(bool pc=true)
set the root to a mac/pc root
Definition: WPSOLEStream.cpp:942
unsigned long count() const
Definition: WPSOLEStream.cpp:167
unsigned long tell() const
Definition: WPSOLEStream.cpp:708
bool is_dir() const
returns true for a directory
Definition: WPSOLEStream.cpp:253
unsigned revision() const
returns the OLE revision
Definition: WPSOLEStream.cpp:512
CompareEntryName(DirTree &tree)
constructor
Definition: WPSOLEStream.cpp:439
Definition: WPSOLEStream.cpp:218
unsigned insertData(unsigned char const *buffer, unsigned long len, bool useBigBlock, unsigned end=Eof)
add stream data in a file, returns the first index
Definition: WPSOLEStream.cpp:1508
static unsigned saveSize()
returns space required to save a dir entry
Definition: WPSOLEStream.cpp:281
unsigned long loadBigBlocks(std::vector< unsigned long > const &blocks, unsigned char *buffer, unsigned long maxlen) const
Definition: WPSOLEStream.cpp:1283
unsigned newBBlock()
create a new big block, resize m_data; ... and return is identifier
Definition: WPSOLEStream.cpp:637
static void writeU16(unsigned char *ptr, unsigned long data)
Definition: WPSOLEStream.cpp:82
const unsigned char * read(unsigned long, unsigned long &) final
! reads numbytes data.
Definition: WPSOLEStream.cpp:1791
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: WPSStringStream.h:41
std::vector< unsigned long > m_sb_blocks
Definition: WPSOLEStream.cpp:486
IStream(IStorage *io, std::string const &name)
Definition: WPSOLEStream.cpp:1538
DirTree()
constructor
Definition: WPSOLEStream.cpp:305
void setName(std::string const &nm)
sets the file name
Definition: WPSOLEStream.cpp:272
DirTree & m_tree
the main tree
Definition: WPSOLEStream.cpp:463
bool isEnd() final
returns true if we are at the end of the section/file
Definition: WPSOLEStream.cpp:1808
WPSOLEStream(RVNGInputStreamPtr &input)
constructor
Definition: WPSOLEStream.cpp:1763
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
AllocTable()
Definition: WPSOLEStream.cpp:162
unsigned long read(unsigned char *data, unsigned long maxlen)
Definition: WPSOLEStream.cpp:712
unsigned saveSize() const
return space required to save a dir entry
Definition: WPSOLEStream.cpp:376
bool m_macRootEntry
false if invalid (should be skipped)
Definition: WPSOLEStream.cpp:287
std::string m_name
the file information
Definition: WPSOLEStream.cpp:298
OStorage(unsigned long minSize=0)
constructor
Definition: WPSOLEStream.cpp:559
Definition: WPSOLEStream.cpp:555
unsigned m_num_bbat
Definition: WPSOLEStream.cpp:679
std::vector< unsigned long > m_data
Definition: WPSOLEStream.cpp:213
unsigned long m_start
size (not valid if directory)
Definition: WPSOLEStream.cpp:291
bool m_isLoad
Definition: WPSOLEStream.cpp:547
Definition: libwps_internal.h:161
void save(unsigned char *buffer) const
saves a entry content in buffer */
Definition: WPSOLEStream.cpp:906
bool addDirectory(std::string const &dir)
add a new directory (usefull to create empty leaf dir )
Definition: WPSOLEStream.cpp:1375
Definition: WPSOLEStream.cpp:158
IStorage * m_iStorage
Definition: WPSOLEStream.cpp:695
unsigned long readData(unsigned long pos, unsigned char *data, unsigned long maxlen)
try to read maxlen data using m_data
Definition: WPSOLEStream.cpp:1582
void setRevision(unsigned rev)
set the OLE revision
Definition: WPSOLEStream.cpp:573
std::vector< std::string > getSubStreamList(unsigned ind=0, bool retrieveAll=false)
returns the list of ind substream
Definition: WPSOLEStream.cpp:358
internal class used to create a RVNGInputStream from an OLE file
Definition: WPSOLEStream.cpp:1759
a comparaison funcion of DirTree used to sort the entry by name
Definition: WPSOLEStream.cpp:436
Definition: WPSOLEStream.cpp:301
@ UnknownError
Definition: WPSOLEStream.cpp:476
~IStream()
Definition: WPSOLEStream.cpp:701
void load(const unsigned char *buffer, unsigned len)
Definition: WPSOLEStream.cpp:186
unsigned m_num_sbat
Definition: WPSOLEStream.cpp:681
@ OpenFailed
Definition: WPSOLEStream.cpp:476
~IStorage()
Definition: WPSOLEStream.cpp:489
unsigned m_right
starting block
Definition: WPSOLEStream.cpp:292
unsigned m_child
next sibling
Definition: WPSOLEStream.cpp:294
size_t getDataAddress(unsigned block, bool isBig) const
returns the address of a big/small block
Definition: WPSOLEStream.cpp:628
void save(unsigned char *buffer) const
Definition: WPSOLEStream.cpp:195
void save(unsigned char *buffer) const
save the list of direntry in buffer
Definition: WPSOLEStream.cpp:383
unsigned m_left
previous sibling
Definition: WPSOLEStream.cpp:293
unsigned long loadBigBlock(unsigned long block, unsigned char *buffer, unsigned long maxlen) const
Definition: WPSOLEStream.cpp:1310
bool hasRootTypePc() const
returns true if it is a pc file
Definition: WPSOLEStream.cpp:314
unsigned long m_pos
Definition: WPSOLEStream.cpp:741
bool readData(RVNGInputStreamPtr &input, unsigned long size, librevenge::RVNGBinaryData &data)
try to read sz bytes from input and store them in a librevenge::RVNGBinaryData
Definition: libwps_internal.cpp:332
Result
Definition: WPSOLEStream.cpp:476
Definition: WPSOLEStream.cpp:243
void get_siblings(unsigned ind, std::set< unsigned > &seens) const
constructs the list of siblings ( by filling the seens set )
Definition: WPSOLEStream.cpp:406
DirEntry * createEntry(std::string const &name)
return a new dir entry, if it does not exists
Definition: WPSOLEStream.cpp:655
Header m_header
Definition: WPSOLEStream.cpp:481
unsigned find_child(unsigned ind, const std::string &name) const
tries to find a child of ind with a given name
Definition: WPSOLEStream.cpp:343
IStorage & operator=(const IStorage &)
AllocTable & operator=(const AllocTable &)
bool hasCLSId() const
returns true if the clsid field is filed
Definition: WPSOLEStream.cpp:231
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
unsigned long readUsingStorage(unsigned long pos, unsigned char *data, unsigned long maxlen)
try to read maxlen data using m_iStorage
Definition: WPSOLEStream.cpp:1596
DirEntry * entry(const std::string &name)
returns the entry with a given name
Definition: WPSOLEStream.cpp:336
bool operator()(unsigned ind1, unsigned ind2) const
comparaison function
Definition: WPSOLEStream.cpp:443
const char * subStreamName(unsigned id) final
returns the ith sub streams name
Definition: WPSOLEStream.cpp:1824
@ NotOLE
Definition: WPSOLEStream.cpp:476
static unsigned long getLength(librevenge::RVNGInputStream *const input)
Definition: WPSOLEStream.cpp:96
const DirEntry * entry(unsigned ind) const
returns the entry with a given index
Definition: WPSOLEStream.cpp:324
unsigned long loadSmallBlocks(std::vector< unsigned long > const &blocks, unsigned char *buffer, unsigned long maxlen)
Definition: WPSOLEStream.cpp:1325
void set(unsigned long index, unsigned long val)
Definition: WPSOLEStream.cpp:175
unsigned subStreamCount() final
returns the number of sub streams.
Definition: WPSOLEStream.cpp:1819
static unsigned readU32(const unsigned char *ptr)
Definition: WPSOLEStream.cpp:77
std::vector< unsigned long > follow(unsigned long start) const
Definition: WPSOLEStream.cpp:831
AllocTable m_sbat
Definition: WPSOLEStream.cpp:680
DirEntry * entry(const std::string &name)
returns a directory entry corresponding to a name
Definition: WPSOLEStream.cpp:498
static void writeU32(unsigned char *ptr, unsigned long data)
Definition: WPSOLEStream.cpp:88
@ MetaBat
Definition: WPSOLEStream.cpp:70
bool hasRootTypePc() const
returns true if it is a pc file
Definition: WPSOLEStream.cpp:517
std::vector< unsigned long > m_sb_blocks
Definition: WPSOLEStream.cpp:683
~OStorage()
destructor
Definition: WPSOLEStream.cpp:565
long tell() final
returns actual offset position
Definition: WPSOLEStream.cpp:1796
Definition: WPSOLEStream.h:33
std::vector< std::string > getSubStreamList(unsigned ind=0, bool all=false)
function to retrieve the list of actual direntry
Definition: WPSOLEStream.cpp:568
std::vector< std::string > getSubStreamList(unsigned ind=0, bool retrieveAll=false)
returns the list of subStream given a dirEntry index
Definition: WPSOLEStream.cpp:524
void setInRedBlackTreeForm()
check/update so that the sibling are store with a red black tree
Definition: WPSOLEStream.cpp:370
unsigned long operator[](unsigned long index) const
Definition: WPSOLEStream.cpp:182
DirEntry()
constructor
Definition: WPSOLEStream.cpp:248
WPSOLEStream & operator=(const WPSOLEStream &)=delete
unsigned saveSize() const
Definition: WPSOLEStream.cpp:207
void load()
Definition: WPSOLEStream.cpp:1181
std::vector< std::string > m_streamNameList
return the name list
Definition: WPSOLEStream.cpp:1852
bool useBigBlockFor(unsigned long size) const
return true if we need to use big block
Definition: WPSOLEStream.cpp:618
RVNGInputStreamPtr m_input
the main input
Definition: WPSOLEStream.cpp:1850
bool isStructured()
Definition: WPSOLEStream.cpp:1156
bool updateToSave()
finish to update the file ( note: it is better to call this function only one time )
Definition: WPSOLEStream.cpp:1399
DirTree m_dirtree
Definition: WPSOLEStream.cpp:482
Definition: WPSOLEStream.cpp:692
void load(unsigned char *buffer, unsigned len)
reads a entry content in buffer
Definition: WPSOLEStream.cpp:860
void setChain(std::vector< unsigned long > chain, unsigned end)
Definition: WPSOLEStream.cpp:850
bool addStream(std::string const &name, unsigned char const *buffer, unsigned long len)
add a new stream knowing its data
Definition: WPSOLEStream.cpp:1384
unsigned m_colour
the type
Definition: WPSOLEStream.cpp:289
@ Bat
Definition: WPSOLEStream.cpp:70
@ NotFound
Definition: WPSOLEStream.cpp:70
bool isSubStream(const std::string &name, bool &isDir)
returns true if the entry exists in the OLE, if so fills isDir
Definition: WPSOLEStream.cpp:1170
librevenge::RVNGInputStream * getSubStreamByName(const char *name) final
return a new stream for a ole zone
Definition: WPSOLEStream.cpp:1858
Definition: WPSOLEStream.cpp:472
unsigned long loadSmallBlock(unsigned long block, unsigned char *buffer, unsigned long maxlen)
Definition: WPSOLEStream.cpp:1360
Generated on Sat Apr 4 2020 02:16:56 for libwps by
doxygen 1.8.17