HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FS_IndexFile Class Reference

#include <FS_IndexFile.h>

+ Inheritance diagram for FS_IndexFile:

Classes

struct  ConversionFuncs
 

Public Types

typedef bool(* ConvertFunc )(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data)
 
typedef UT_ArrayStringMap
< ConversionFuncs
ConversionList
 

Public Member Functions

 FS_IndexFile ()
 Default constructor. More...
 
 FS_IndexFile (const char *source)
 
 FS_IndexFile (FS_Reader *reader, const char *source=nullptr)
 
virtual ~FS_IndexFile ()
 
bool hasSection (const UT_StringRef &section) const
 
bool hasTempSection (const UT_StringRef &section) const
 
bool hasRegularSection (const UT_StringRef &section) const
 
time_t getSectionModTime (const UT_StringRef &section) const
 
int getSectionDataSize (const UT_StringRef &section) const
 
bool readSection (const UT_StringRef &section, char *buffer) const
 
bool readSection (const UT_StringRef &section, UT_WorkBuffer &buffer) const
 
bool readOptionsSection (const UT_StringRef &section, UT_Options &options) const
 
void addSection (const UT_StringRef &section, const char *filename)
 
void addSection (const UT_StringRef &section, const UT_WorkBuffer &buf, time_t modtime=time_t(-1))
 
void addSection (const UT_StringRef &section, const char *buffer, int len, time_t modtime=time_t(-1))
 
void addSection (const UT_StringRef &section, const FS_IndexFile &file)
 
void modifySection (const UT_StringRef &section, const char *buffer, int len, time_t modtime=time_t(-1))
 
void modifySection (const UT_StringRef &section, const UT_WorkBuffer &buf, time_t modtime=time_t(-1))
 
void removeSection (const UT_StringRef &section)
 
void mergeIndexFile (const FS_IndexFile &file, bool overwrite)
 
void moveSections (int first, int last, int offset)
 
time_t getModTime () const
 
int64 getFileDataSize () const
 
void setFilters (FS_WriteFilterFactory *encrypt_factory, FS_IStreamFilterFactory *decrypt_factory)
 
FS_WriteFilterFactorygetEncryptionFilter () const
 
FS_IStreamFilterFactorygetDecryptionFilter () const
 
FS_SectiongetSection (const UT_StringRef &section) const
 
FS_ReadergetSectionReader (const UT_StringRef &section) const
 
FS_ReaderStreamgetSectionStream (const UT_StringRef &section) const
 
FS_ReaderStreamgetStreamCopy () const
 
FS_IndexFileHandle getIndexFileFromSection (const UT_StringRef &section, const char *source=nullptr) const
 
int getNumSections () const
 
const UT_StringHoldergetSectionName (int index) const
 
const UT_StringHoldergetSourceFile () const
 
const UT_StringHoldergetDescription () const
 
void setDescription (const UT_StringHolder &description)
 
exint guessStreamSize () const
 
virtual void writeFile (std::ostream &os) const
 
virtual bool expandToDirectory (const char *destdir)
 
virtual bool collapseFromDirectory (const char *srcdir)
 
bool isCopyProtected () const
 Tests if the index file is copy-protected. More...
 
bool isBlackBoxed () const
 Tests if the index file is black boxed. More...
 
bool isExpanded () const
 Tests if the index file is stored as expanded. More...
 
bool getSectionFileName (const char *section, UT_String &filename)
 

Static Public Member Functions

static time_t getCurrentTime ()
 
static bool canWriteFile (const char *filename)
 
static bool registerConversionFuncs (const char *bin_file_pattern, const char *text_file_pattern, ConvertFunc to_text, ConvertFunc from_text)
 
static const ConversionListgetConversionsToText ()
 
static const ConversionListgetConversionsFromText ()
 

Protected Member Functions

void setModified ()
 
exint writeHeader (std::ostream &os) const
 

Static Protected Member Functions

static ConversionList_getConversionsToText ()
 
static ConversionList_getConversionsFromText ()
 

Protected Attributes

UT_Lock myLock
 

Friends

class FS_Section
 
class FS_EmbeddedSection
 
class FS_DiskSection
 
class FS_IndexFileHandle
 

Detailed Description

Definition at line 43 of file FS_IndexFile.h.

Member Typedef Documentation

typedef bool(* FS_IndexFile::ConvertFunc)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data)

Definition at line 193 of file FS_IndexFile.h.

Constructor & Destructor Documentation

FS_IndexFile::FS_IndexFile ( )

Default constructor.

FS_IndexFile::FS_IndexFile ( const char *  source)

This constructor takes a path of some sort (e.g. a file path, an oplib: path, an opdef: path, an http:// path, etc) to the index file.

FS_IndexFile::FS_IndexFile ( FS_Reader reader,
const char *  source = nullptr 
)

This constructor takes a reader that will be used to retrieve section data. The index file takes ownership and will delete the reader in the destructor. (If null is passed in, this object creates its own default FS_Reader, but unless a source is given nothing can be read from such an index file.)

If no source is given, closing the index file and reopening it again will have no effect on the underlying reader. The reader will only be closed and deleted when the index file object is deleted. If a source is passed in, though, the reader will be deleted when the index file is closed and subsequent openings will use the source path to construct a new reader.

virtual FS_IndexFile::~FS_IndexFile ( )
virtual

Member Function Documentation

static ConversionList& FS_IndexFile::_getConversionsFromText ( )
staticprotected
static ConversionList& FS_IndexFile::_getConversionsToText ( )
staticprotected
void FS_IndexFile::addSection ( const UT_StringRef section,
const char *  filename 
)
void FS_IndexFile::addSection ( const UT_StringRef section,
const UT_WorkBuffer buf,
time_t  modtime = time_t(-1) 
)
void FS_IndexFile::addSection ( const UT_StringRef section,
const char *  buffer,
int  len,
time_t  modtime = time_t(-1) 
)
void FS_IndexFile::addSection ( const UT_StringRef section,
const FS_IndexFile file 
)
static bool FS_IndexFile::canWriteFile ( const char *  filename)
static
virtual bool FS_IndexFile::collapseFromDirectory ( const char *  srcdir)
virtual

Reimplemented in OP_OTLLibrary.

virtual bool FS_IndexFile::expandToDirectory ( const char *  destdir)
virtual

Reimplemented in OP_OTLLibrary.

static const ConversionList& FS_IndexFile::getConversionsFromText ( )
static
static const ConversionList& FS_IndexFile::getConversionsToText ( )
static
static time_t FS_IndexFile::getCurrentTime ( )
inlinestatic

Definition at line 169 of file FS_IndexFile.h.

FS_IStreamFilterFactory* FS_IndexFile::getDecryptionFilter ( ) const
const UT_StringHolder& FS_IndexFile::getDescription ( ) const
FS_WriteFilterFactory* FS_IndexFile::getEncryptionFilter ( ) const
int64 FS_IndexFile::getFileDataSize ( ) const
FS_IndexFileHandle FS_IndexFile::getIndexFileFromSection ( const UT_StringRef section,
const char *  source = nullptr 
) const
time_t FS_IndexFile::getModTime ( ) const
int FS_IndexFile::getNumSections ( ) const
FS_Section* FS_IndexFile::getSection ( const UT_StringRef section) const
int FS_IndexFile::getSectionDataSize ( const UT_StringRef section) const
bool FS_IndexFile::getSectionFileName ( const char *  section,
UT_String filename 
)
time_t FS_IndexFile::getSectionModTime ( const UT_StringRef section) const
const UT_StringHolder& FS_IndexFile::getSectionName ( int  index) const
FS_Reader* FS_IndexFile::getSectionReader ( const UT_StringRef section) const
FS_ReaderStream* FS_IndexFile::getSectionStream ( const UT_StringRef section) const
const UT_StringHolder& FS_IndexFile::getSourceFile ( ) const
inline

Definition at line 145 of file FS_IndexFile.h.

FS_ReaderStream* FS_IndexFile::getStreamCopy ( ) const
exint FS_IndexFile::guessStreamSize ( ) const
bool FS_IndexFile::hasRegularSection ( const UT_StringRef section) const
inline

Definition at line 78 of file FS_IndexFile.h.

bool FS_IndexFile::hasSection ( const UT_StringRef section) const
inline

Definition at line 73 of file FS_IndexFile.h.

bool FS_IndexFile::hasTempSection ( const UT_StringRef section) const
inline

Definition at line 76 of file FS_IndexFile.h.

bool FS_IndexFile::isBlackBoxed ( ) const

Tests if the index file is black boxed.

bool FS_IndexFile::isCopyProtected ( ) const

Tests if the index file is copy-protected.

bool FS_IndexFile::isExpanded ( ) const
inline

Tests if the index file is stored as expanded.

Definition at line 182 of file FS_IndexFile.h.

void FS_IndexFile::mergeIndexFile ( const FS_IndexFile file,
bool  overwrite 
)
void FS_IndexFile::modifySection ( const UT_StringRef section,
const char *  buffer,
int  len,
time_t  modtime = time_t(-1) 
)
void FS_IndexFile::modifySection ( const UT_StringRef section,
const UT_WorkBuffer buf,
time_t  modtime = time_t(-1) 
)
void FS_IndexFile::moveSections ( int  first,
int  last,
int  offset 
)
bool FS_IndexFile::readOptionsSection ( const UT_StringRef section,
UT_Options options 
) const
bool FS_IndexFile::readSection ( const UT_StringRef section,
char *  buffer 
) const
bool FS_IndexFile::readSection ( const UT_StringRef section,
UT_WorkBuffer buffer 
) const
static bool FS_IndexFile::registerConversionFuncs ( const char *  bin_file_pattern,
const char *  text_file_pattern,
ConvertFunc  to_text,
ConvertFunc  from_text 
)
static
void FS_IndexFile::removeSection ( const UT_StringRef section)
void FS_IndexFile::setDescription ( const UT_StringHolder description)
void FS_IndexFile::setFilters ( FS_WriteFilterFactory encrypt_factory,
FS_IStreamFilterFactory decrypt_factory 
)
void FS_IndexFile::setModified ( )
inlineprotected

Definition at line 241 of file FS_IndexFile.h.

virtual void FS_IndexFile::writeFile ( std::ostream &  os) const
virtual

Reimplemented in OP_OTLLibrary.

exint FS_IndexFile::writeHeader ( std::ostream &  os) const
protected

Friends And Related Function Documentation

friend class FS_DiskSection
friend

Definition at line 307 of file FS_IndexFile.h.

friend class FS_EmbeddedSection
friend

Definition at line 306 of file FS_IndexFile.h.

friend class FS_IndexFileHandle
friend

Definition at line 308 of file FS_IndexFile.h.

friend class FS_Section
friend

Definition at line 305 of file FS_IndexFile.h.

Member Data Documentation

UT_Lock FS_IndexFile::myLock
mutableprotected

Definition at line 248 of file FS_IndexFile.h.


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