librevenge::OStorage Class Reference

Public Member Functions

 OStorage (unsigned long minSize=0)
 constructor
 ~OStorage ()
 destructor
std::vector< std::string > getSubStreamList (unsigned ind=0, bool all=false)
 function to retrieve the list of actual direntry
void setRevision (unsigned rev)
 set the OLE revision
void setRootType (bool pc)
 set the root to a mac/pc root *‍/
bool addStream (std::string const &name, unsigned char const *buffer, unsigned long len)
 add a new stream knowing its data
bool addDirectory (std::string const &dir)
 add a new directory (usefull to create empty leaf dir )
void setInformation (std::string const &name, DirInfo const &info)
 set a node information
bool getFileData (std::vector< unsigned char > &data)
 try to return in data the contain of the file

Protected Member Functions

unsigned insertData (unsigned char const *buffer, unsigned long len, bool useBigBlock, unsigned end=Eof)
 add stream data in a file, returns the first index
bool useBigBlockFor (unsigned long size) const
 return true if we need to use big block
size_t getDataAddress (unsigned block, bool isBig) const
 returns the address of a big/small block
unsigned newBBlock ()
 create a new big block, resize m_data; ... and return is identifier
unsigned newSBlock ()
 create a new small block, ... and returns is identifier
DirEntrycreateEntry (std::string const &name)
 return a new dir entry, if it does not exists
bool updateToSave ()
 finish to update the file ( note: it is better to call this function only one time )

Static Protected Member Functions

static unsigned long getMaximumSize (bool isBig)
 returns the maximum size of a big/small block

Protected Attributes

Header m_header
DirTree m_dirtree
AllocTable m_bbat
unsigned m_num_bbat
AllocTable m_sbat
unsigned m_num_sbat
std::vector< unsigned long > m_sb_blocks
std::vector< unsigned char > m_data

Private Member Functions

 OStorage (const OStorage &)
OStorageoperator= (const OStorage &)

Constructor & Destructor Documentation

◆ OStorage() [1/2]

librevenge::OStorage::OStorage ( unsigned long minSize = 0)
inline

constructor

Referenced by operator=(), and OStorage().

◆ ~OStorage()

librevenge::OStorage::~OStorage ( )
inline

destructor

◆ OStorage() [2/2]

librevenge::OStorage::OStorage ( const OStorage & )
private

Member Function Documentation

◆ addDirectory()

bool librevenge::OStorage::addDirectory ( std::string const & dir)

add a new directory (usefull to create empty leaf dir )

Referenced by librevenge::IStream::createOleFromDirectory().

◆ addStream()

bool librevenge::OStorage::addStream ( std::string const & name,
unsigned char const * buffer,
unsigned long len )

add a new stream knowing its data

Referenced by librevenge::IStream::createOleFromDirectory().

◆ createEntry()

DirEntry * librevenge::OStorage::createEntry ( std::string const & name)
inlineprotected

return a new dir entry, if it does not exists

Referenced by addDirectory(), and addStream().

◆ getDataAddress()

size_t librevenge::OStorage::getDataAddress ( unsigned block,
bool isBig ) const
inlineprotected

returns the address of a big/small block

Referenced by insertData().

◆ getFileData()

bool librevenge::OStorage::getFileData ( std::vector< unsigned char > & data)
inline

try to return in data the contain of the file

Referenced by librevenge::IStream::createOleFromDirectory().

◆ getMaximumSize()

unsigned long librevenge::OStorage::getMaximumSize ( bool isBig)
inlinestaticprotected

returns the maximum size of a big/small block

Referenced by insertData().

◆ getSubStreamList()

std::vector< std::string > librevenge::OStorage::getSubStreamList ( unsigned ind = 0,
bool all = false )
inline

function to retrieve the list of actual direntry

Referenced by librevenge::IStream::createOleFromDirectory().

◆ insertData()

unsigned librevenge::OStorage::insertData ( unsigned char const * buffer,
unsigned long len,
bool useBigBlock,
unsigned end = Eof )
protected

add stream data in a file, returns the first index

Referenced by addStream(), and updateToSave().

◆ newBBlock()

unsigned librevenge::OStorage::newBBlock ( )
inlineprotected

create a new big block, resize m_data; ... and return is identifier

Referenced by insertData(), and newSBlock().

◆ newSBlock()

unsigned librevenge::OStorage::newSBlock ( )
inlineprotected

create a new small block, ... and returns is identifier

Referenced by insertData().

◆ operator=()

OStorage & librevenge::OStorage::operator= ( const OStorage & )
private

◆ setInformation()

void librevenge::OStorage::setInformation ( std::string const & name,
DirInfo const & info )
inline

set a node information

Referenced by librevenge::IStream::createOleFromDirectory().

◆ setRevision()

void librevenge::OStorage::setRevision ( unsigned rev)
inline

set the OLE revision

Referenced by librevenge::IStream::createOleFromDirectory().

◆ setRootType()

void librevenge::OStorage::setRootType ( bool pc)
inline

set the root to a mac/pc root *‍/

Referenced by librevenge::IStream::createOleFromDirectory().

◆ updateToSave()

bool librevenge::OStorage::updateToSave ( )
protected

finish to update the file ( note: it is better to call this function only one time )

Referenced by getFileData().

◆ useBigBlockFor()

bool librevenge::OStorage::useBigBlockFor ( unsigned long size) const
inlineprotected

return true if we need to use big block

Referenced by addStream().

Member Data Documentation

◆ m_bbat

AllocTable librevenge::OStorage::m_bbat
protected

◆ m_data

std::vector<unsigned char> librevenge::OStorage::m_data
protected

◆ m_dirtree

DirTree librevenge::OStorage::m_dirtree
protected

◆ m_header

Header librevenge::OStorage::m_header
protected

◆ m_num_bbat

unsigned librevenge::OStorage::m_num_bbat
protected

Referenced by newBBlock(), OStorage(), and updateToSave().

◆ m_num_sbat

unsigned librevenge::OStorage::m_num_sbat
protected

Referenced by newSBlock(), OStorage(), and updateToSave().

◆ m_sb_blocks

std::vector<unsigned long> librevenge::OStorage::m_sb_blocks
protected

◆ m_sbat

AllocTable librevenge::OStorage::m_sbat
protected

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

Generated for librevenge by doxygen 1.14.0