HDK
|
#include <FS_IndexFile.h>
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 §ion) const |
bool | hasTempSection (const UT_StringRef §ion) const |
bool | hasRegularSection (const UT_StringRef §ion) const |
time_t | getSectionModTime (const UT_StringRef §ion) const |
int | getSectionDataSize (const UT_StringRef §ion) const |
bool | readSection (const UT_StringRef §ion, char *buffer) const |
bool | readSection (const UT_StringRef §ion, UT_WorkBuffer &buffer) const |
bool | readOptionsSection (const UT_StringRef §ion, UT_Options &options) const |
void | addSection (const UT_StringRef §ion, const char *filename) |
void | addSection (const UT_StringRef §ion, const UT_WorkBuffer &buf, time_t modtime=time_t(-1)) |
void | addSection (const UT_StringRef §ion, const char *buffer, int len, time_t modtime=time_t(-1)) |
void | addSection (const UT_StringRef §ion, const FS_IndexFile &file) |
void | modifySection (const UT_StringRef §ion, const char *buffer, int len, time_t modtime=time_t(-1)) |
void | modifySection (const UT_StringRef §ion, const UT_WorkBuffer &buf, time_t modtime=time_t(-1)) |
void | removeSection (const UT_StringRef §ion) |
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_WriteFilterFactory * | getEncryptionFilter () const |
FS_IStreamFilterFactory * | getDecryptionFilter () const |
FS_Section * | getSection (const UT_StringRef §ion) const |
FS_Reader * | getSectionReader (const UT_StringRef §ion) const |
FS_ReaderStream * | getSectionStream (const UT_StringRef §ion) const |
FS_ReaderStream * | getStreamCopy () const |
FS_IndexFileHandle | getIndexFileFromSection (const UT_StringRef §ion, const char *source=nullptr) const |
int | getNumSections () const |
const UT_StringHolder & | getSectionName (int index) const |
const UT_StringHolder & | getSourceFile () const |
const UT_StringHolder & | getDescription () 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 void | clearStartupCache () |
static bool | registerConversionFuncs (const char *bin_file_pattern, const char *text_file_pattern, ConvertFunc to_text, ConvertFunc from_text) |
static const ConversionList & | getConversionsToText () |
static const ConversionList & | getConversionsFromText () |
Protected Member Functions | |
void | setModified () |
exint | writeHeader (std::ostream &os, const UT_Int32Array §ion_sizes) 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 |
Definition at line 44 of file FS_IndexFile.h.
Definition at line 231 of file FS_IndexFile.h.
typedef bool(* FS_IndexFile::ConvertFunc)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data) |
Definition at line 196 of file FS_IndexFile.h.
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 |
|
staticprotected |
|
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 |
|
static |
|
virtual |
Reimplemented in OP_OTLLibrary.
|
virtual |
Reimplemented in OP_OTLLibrary.
|
static |
|
static |
|
inlinestatic |
Definition at line 170 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 |
|
inline |
Definition at line 146 of file FS_IndexFile.h.
FS_ReaderStream* FS_IndexFile::getStreamCopy | ( | ) | const |
exint FS_IndexFile::guessStreamSize | ( | ) | const |
|
inline |
Definition at line 79 of file FS_IndexFile.h.
|
inline |
Definition at line 74 of file FS_IndexFile.h.
|
inline |
Definition at line 77 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.
|
inline |
Tests if the index file is stored as expanded.
Definition at line 183 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) |
||
) |
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 |
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 | ||
) |
|
inlineprotected |
Definition at line 244 of file FS_IndexFile.h.
|
virtual |
Reimplemented in OP_OTLLibrary.
|
protected |
|
friend |
Definition at line 311 of file FS_IndexFile.h.
|
friend |
Definition at line 310 of file FS_IndexFile.h.
|
friend |
Definition at line 312 of file FS_IndexFile.h.
|
friend |
Definition at line 309 of file FS_IndexFile.h.
|
mutableprotected |
Definition at line 252 of file FS_IndexFile.h.