libmwawOLE::OStorage Class Reference

Public Member Functions

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

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 More...
 
bool useBigBlockFor (unsigned long size) const
 return true if we need to use big block More...
 
unsigned long getMaximumSize (bool isBig) const
 returns the maximum size of a big/small block More...
 
size_t getDataAddress (unsigned block, bool isBig) const
 returns the address of a big/small block More...
 
unsigned newBBlock ()
 create a new big block, resize m_data; ... and return is identifier More...
 
unsigned newSBlock ()
 create a new small block, ... and returns is identifier More...
 
DirEntrycreateEntry (std::string const &name)
 return a new dir entry, if it does not exists More...
 
bool updateToSave ()
 finish to update the file ( note: it is better to call this function only one time ) More...
 

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

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

constructor

libmwawOLE::OStorage::~OStorage ( )
inline

destructor

libmwawOLE::OStorage::OStorage ( const OStorage )
private

Member Function Documentation

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

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

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

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

add a new stream knowing its data

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

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

return a new dir entry, if it does not exists

Referenced by addDirectory(), and addStream().

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

returns the address of a big/small block

Referenced by insertData().

unsigned long libmwawOLE::OStorage::getMaximumSize ( bool  isBig) const
inlineprotected

returns the maximum size of a big/small block

Referenced by insertData().

shared_ptr<WPXInputStream> libmwawOLE::OStorage::getStream ( )
inline

try to return a stream containing the ole file

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

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

function to retrieve the list of actual direntry

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

unsigned libmwawOLE::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().

unsigned libmwawOLE::OStorage::newBBlock ( )
inlineprotected

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

Referenced by insertData(), and newSBlock().

unsigned libmwawOLE::OStorage::newSBlock ( )
inlineprotected

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

Referenced by insertData().

OStorage& libmwawOLE::OStorage::operator= ( const OStorage )
private
void libmwawOLE::OStorage::setInformation ( std::string const &  name,
DirInfo const &  info 
)
inline

set a node information

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

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

set the OLE revision

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

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

set the root to a mac/pc root */

Referenced by libmwawOLE::Storage::getSubStreamForDirectory().

bool libmwawOLE::OStorage::updateToSave ( )
protected

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

Referenced by getStream().

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

return true if we need to use big block

Referenced by addStream().

Member Data Documentation

AllocTable libmwawOLE::OStorage::m_bbat
protected

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

std::vector<unsigned char> libmwawOLE::OStorage::m_data
protected
DirTree libmwawOLE::OStorage::m_dirtree
protected
Header libmwawOLE::OStorage::m_header
protected
unsigned libmwawOLE::OStorage::m_num_bbat
protected

Referenced by newBBlock(), and updateToSave().

unsigned libmwawOLE::OStorage::m_num_sbat
protected

Referenced by newSBlock(), and updateToSave().

std::vector<unsigned long> libmwawOLE::OStorage::m_sb_blocks
protected
AllocTable libmwawOLE::OStorage::m_sbat
protected

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


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

Generated on Sat May 4 2013 20:11:13 for libmwaw by doxygen 1.8.3.1