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

#include <OP_OTLLibrary.h>

+ Inheritance diagram for OP_OTLLibrary:

Public Types

enum  OP_ModTimeStatus {
  MOD_TIME_OK, MOD_TIME_INTERNAL, MOD_TIME_SAVE_QUIT, MOD_TIME_DISCARD_QUIT,
  MOD_TIME_EMBED, MOD_TIME_REFRESH_ALL, MOD_TIME_LOAD_FILE
}
 
- Public Types inherited from FS_IndexFile
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

 OP_OTLLibrary ()
 
 OP_OTLLibrary (FS_Reader *reader)
 
 OP_OTLLibrary (const char *source, const char *metasrc)
 
 ~OP_OTLLibrary () override
 
const UT_StringHolder & getMetaSource () const
 
const UT_StringHolder & getSource () const
 
OP_ModTimeStatus getSourceModTime (time_t &mod_time, const char *type_name=NULL) const
 
bool addDefinition (const OP_OTLDefinition &definition, time_t modtime=time_t(-1))
 
bool removeDefinition (int index)
 
int getNumDefinitions () const
 
const OP_OTLDefinition & getDefinition (int index) const
 
int getDefinitionIndex (const char *tablename, const char *opname) const
 
time_t getDefinitionModTime (int index) const
 
const UT_StringHolder & getDefinitionName (int index) const
 
const UT_StringHolder & getDefinitionOpTableName (int index) const
 
bool getDefinitionIsDummy (int index) const
 
bool getDefinition (int index, OP_OTLDefinition &definition) const
 
FS_IndexFileHandle getDefinitionIndexFile (const char *tablename, const char *opname) const
 
bool removeDefinitionSectionIfEmpty (int index, const char *definition_section)
 
void mergeLibrary (const OP_OTLLibrary &lib)
 
bool expandToDirectory (const char *destdir) override
 
bool collapseFromDirectory (const char *srcdir) override
 
void writeFile (std::ostream &os) const override
 
void setIsBeingRefreshed (bool beingrefreshed)
 
bool getIsBeingRefreshed () const
 
void beginCachingSourceModTime ()
 
void endCachingSourceModTime ()
 
bool getIsModTimeAccessOK () const
 
const UT_StringArray & getErrorMessages () const
 
- Public Member Functions inherited from FS_IndexFile
 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_WriteFilterFactory * getEncryptionFilter () const
 
FS_IStreamFilterFactory * getDecryptionFilter () const
 
FS_Section * getSection (const UT_StringRef &section) const
 
FS_Reader * getSectionReader (const UT_StringRef &section) const
 
FS_ReaderStream * getSectionStream (const UT_StringRef &section) const
 
FS_ReaderStream * getStreamCopy () const
 
FS_IndexFileHandle getIndexFileFromSection (const UT_StringRef &section, 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
 
bool checkWriteSizeLimits () const
 
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 bool forceOTLExtension (UT_String &filename)
 
static void getVexAndVflSectionNames (const char *suggestion, UT_String &vexsect, UT_String &vflsect)
 
static void getVexCodeSectionName (const char *prefix, UT_String &vex_code_sect)
 Constructs a valid VEX code section, with an optional prefix. More...
 
static bool createBackupFile (const char *filename, bool domove=false)
 
static bool isReservedSectionName (const UT_StringRef &sectname)
 
static const char * getEventName (int index)
 
static const UT_StringHolder & getEventSectionName (int index)
 
static const UT_StringHolder & getVexCodeSectionName (VEX_ContextType type)
 
static const UT_StringHolder & getVflCodeSectionName (VEX_ContextType type)
 
static const UT_StringHolder & getEncapsulatedVexSectionName (VEX_ContextType type)
 
static UT_StringHolder getShaderPathWithSection (const UT_StringRef &shader, VEX_ContextType type, UT_String *opname=nullptr)
 
static bool getFilenames (const UT_StringHolder &libfile, UT_StringArray &filenames)
 
static const char * getDefaultInstallMetaSource (const char *lib_path)
 
- Static Public Member Functions inherited from FS_IndexFile
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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from FS_IndexFile
void setModified ()
 
exint writeHeader (std::ostream &os, const UT_Int32Array &section_sizes) const
 
FS_IndexSizeOverflowCheck overflowCheck (int &bad_index, exint &max_offset) const
 
- Static Protected Member Functions inherited from FS_IndexFile
static ConversionList & _getConversionsToText ()
 
static ConversionList & _getConversionsFromText ()
 
- Protected Attributes inherited from FS_IndexFile
UT_Lock myLock
 

Detailed Description

Definition at line 44 of file OP_OTLLibrary.h.

Member Enumeration Documentation

Enumerator
MOD_TIME_OK 
MOD_TIME_INTERNAL 
MOD_TIME_SAVE_QUIT 
MOD_TIME_DISCARD_QUIT 
MOD_TIME_EMBED 
MOD_TIME_REFRESH_ALL 
MOD_TIME_LOAD_FILE 

Definition at line 55 of file OP_OTLLibrary.h.

Constructor & Destructor Documentation

OP_OTLLibrary::OP_OTLLibrary ( )
OP_OTLLibrary::OP_OTLLibrary ( FS_Reader *  reader)
OP_OTLLibrary::OP_OTLLibrary ( const char *  source,
const char *  metasrc 
)
OP_OTLLibrary::~OP_OTLLibrary ( )
override

Member Function Documentation

bool OP_OTLLibrary::addDefinition ( const OP_OTLDefinition &  definition,
time_t  modtime = time_t(-1) 
)
void OP_OTLLibrary::beginCachingSourceModTime ( )
bool OP_OTLLibrary::collapseFromDirectory ( const char *  srcdir)
overridevirtual

Reimplemented from FS_IndexFile.

static bool OP_OTLLibrary::createBackupFile ( const char *  filename,
bool  domove = false 
)
static
void OP_OTLLibrary::endCachingSourceModTime ( )
bool OP_OTLLibrary::expandToDirectory ( const char *  destdir)
overridevirtual

Reimplemented from FS_IndexFile.

static bool OP_OTLLibrary::forceOTLExtension ( UT_String &  filename)
static

Checks if filename has a .otl, if not, appends it. Respects OTL_INTERNAL and other magic constants. Returns true if filename was modified

static const char* OP_OTLLibrary::getDefaultInstallMetaSource ( const char *  lib_path)
static
const OP_OTLDefinition& OP_OTLLibrary::getDefinition ( int  index) const
inline

Definition at line 98 of file OP_OTLLibrary.h.

bool OP_OTLLibrary::getDefinition ( int  index,
OP_OTLDefinition &  definition 
) const
int OP_OTLLibrary::getDefinitionIndex ( const char *  tablename,
const char *  opname 
) const
FS_IndexFileHandle OP_OTLLibrary::getDefinitionIndexFile ( const char *  tablename,
const char *  opname 
) const
bool OP_OTLLibrary::getDefinitionIsDummy ( int  index) const
time_t OP_OTLLibrary::getDefinitionModTime ( int  index) const
const UT_StringHolder& OP_OTLLibrary::getDefinitionName ( int  index) const
const UT_StringHolder& OP_OTLLibrary::getDefinitionOpTableName ( int  index) const
static const UT_StringHolder& OP_OTLLibrary::getEncapsulatedVexSectionName ( VEX_ContextType  type)
static
const UT_StringArray& OP_OTLLibrary::getErrorMessages ( ) const
static const char* OP_OTLLibrary::getEventName ( int  index)
static
static const UT_StringHolder& OP_OTLLibrary::getEventSectionName ( int  index)
static
static bool OP_OTLLibrary::getFilenames ( const UT_StringHolder &  libfile,
UT_StringArray &  filenames 
)
static
bool OP_OTLLibrary::getIsBeingRefreshed ( ) const
bool OP_OTLLibrary::getIsModTimeAccessOK ( ) const
const UT_StringHolder& OP_OTLLibrary::getMetaSource ( ) const
int OP_OTLLibrary::getNumDefinitions ( ) const
inline

Definition at line 95 of file OP_OTLLibrary.h.

static UT_StringHolder OP_OTLLibrary::getShaderPathWithSection ( const UT_StringRef &  shader,
VEX_ContextType  type,
UT_String *  opname = nullptr 
)
static
const UT_StringHolder& OP_OTLLibrary::getSource ( ) const
OP_ModTimeStatus OP_OTLLibrary::getSourceModTime ( time_t &  mod_time,
const char *  type_name = NULL 
) const
static void OP_OTLLibrary::getVexAndVflSectionNames ( const char *  suggestion,
UT_String &  vexsect,
UT_String &  vflsect 
)
static

Constructs a good vfl and vex code section names given the original suggestion.

static void OP_OTLLibrary::getVexCodeSectionName ( const char *  prefix,
UT_String &  vex_code_sect 
)
static

Constructs a valid VEX code section, with an optional prefix.

static const UT_StringHolder& OP_OTLLibrary::getVexCodeSectionName ( VEX_ContextType  type)
static
static const UT_StringHolder& OP_OTLLibrary::getVflCodeSectionName ( VEX_ContextType  type)
static
static bool OP_OTLLibrary::isReservedSectionName ( const UT_StringRef &  sectname)
static
void OP_OTLLibrary::mergeLibrary ( const OP_OTLLibrary &  lib)
bool OP_OTLLibrary::removeDefinition ( int  index)
bool OP_OTLLibrary::removeDefinitionSectionIfEmpty ( int  index,
const char *  definition_section 
)
void OP_OTLLibrary::setIsBeingRefreshed ( bool  beingrefreshed)
void OP_OTLLibrary::writeFile ( std::ostream &  os) const
overridevirtual

Reimplemented from FS_IndexFile.


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