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

#include <OP_OTLUtils.h>

Classes

struct  ConversionFuncs
 

Public Types

typedef bool(* ConvertSectionToTextFunc )(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, bool &store_external)
 
typedef bool(* ConvertSectionFromTextFunc )(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data)
 
typedef bool(* ConvertSectionToTextFuncEx )(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, bool &store_external, void *conversion_data)
 
typedef bool(* ConvertSectionFromTextFuncEx )(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, void *conversion_data)
 
typedef UT_StringMap
< ConversionFuncs
ConversionList
 
typedef UT_Map
< UT_StringHolder,
UT_CompressionType
CompressionMap
 

Public Member Functions

 OP_OTLUtils ()
 

Static Public Member Functions

static OP_OTLUtilsgetInstance ()
 
static bool getContentsSection (FS_IndexFile &indexFile, UT_WorkBuffer &data)
 
static UT_UniquePtr< UT_IStreamgetContentsStream (FS_IndexFile &deffile, exint *uncompressed_buflen=nullptr)
 
static UT_UniquePtr< UT_IStreamgetContentsStream (UT_IStream &is, exint nbytes, const UT_StringHolder &file_name, exint *uncompressed_buflen=nullptr)
 
static bool saveContentsSection (FS_IndexFile &indexFile, const UT_WorkBuffer &contents_cpio)
 
static bool processContentsSection (FS_IndexFile &indexFile, const UT_String &section_name)
 
static bool expandToDirectory (OP_OTLLibrary *library, const char *destdir, bool vcsfriendly=false)
 
static bool collapseLibrary (const char *libfile, const char *srcdir, bool createbackup=true)
 
static void findAllSections (const char *srcdir, const char *filename, UT_StringArray &allfiles, bool append=false)
 
static void findAllMimeSections (const char *srcdir, UT_StringArray &allfiles, bool append=false)
 
static bool isExpandedOtl (const char *src)
 
static bool getContentsAsText (FS_IndexFile &indexfile, UT_WorkBuffer &contents_text, bool strip_modtime=true)
 
static bool getNetworkSummary (UT_IStream &is, UT_WorkBuffer &summary, const char *prefix=nullptr, bool isHipFile=false)
 
static bool getNetworkSummary (OP_Network *network, UT_WorkBuffer &summary, const char *prefix=nullptr, const char *root_name=nullptr)
 
static bool compressContents (const UT_WorkBuffer &contents_cpio, UT_CompressionType compression_type, std::ostream *os)
 
static bool convertContentsFromText (const UT_StringArray &files, UT_StringArray &out_delete_files)
 
static bool convertContentsToText (const UT_StringArray &files, bool preserve_modtime, UT_StringArray &out_delete_files)
 
static bool registerConversionFuncs (const UT_StringHolder &extension, ConvertSectionToTextFunc to_text, ConvertSectionFromTextFunc from_text)
 
static bool registerConversionFuncsEx (const UT_StringHolder &extension, ConvertSectionToTextFuncEx to_text, ConvertSectionFromTextFuncEx from_text)
 
static const ConversionListgetConversions ()
 
static bool CPIOToMIME (UT_IStream &is, std::ostream &os, bool preserve_modtime, const char *externals_dest=nullptr)
 
static bool MIMEToCPIO (UT_IStream &is, std::ostream &os, const char *externals_dest=nullptr)
 
static bool CPIOToMIME (UT_IStream &is, std::ostream &os, bool preserve_modtime, const char *externals_dest, OTLConversionData *conversion_data)
 
static bool MIMEToCPIO (UT_IStream &is, std::ostream &os, const char *externals_dest, OTLConversionData *conversion_data)
 
static bool _convertContentsToText (UT_IStream &is, const UT_String &dir_name, bool preserve_modtime, std::ostream &os)
 
static bool _convertContentsFromText (UT_IStream &is, const UT_String &dir_name, UT_CompressionType compression_type, std::ostream &os)
 
static UT_StringHolder getNameFromCompression (UT_CompressionType compression_type)
 
static UT_CompressionType getCompressionFromName (const UT_StringHolder &section_name)
 
static UT_CompressionType getCompressionFromOptionsFile (const UT_StringHolder &options_filename)
 

Static Public Attributes

static const UT_StringArray allContentsSectionNames
 
static const CompressionMap contentsCompressionNameMap
 

Detailed Description

Definition at line 36 of file OP_OTLUtils.h.

Member Typedef Documentation

typedef bool(* OP_OTLUtils::ConvertSectionFromTextFunc)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data)

Definition at line 147 of file OP_OTLUtils.h.

typedef bool(* OP_OTLUtils::ConvertSectionFromTextFuncEx)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, void *conversion_data)

Definition at line 157 of file OP_OTLUtils.h.

typedef bool(* OP_OTLUtils::ConvertSectionToTextFunc)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, bool &store_external)

Definition at line 142 of file OP_OTLUtils.h.

typedef bool(* OP_OTLUtils::ConvertSectionToTextFuncEx)(const UT_StringHolder &src_path, const UT_WorkBuffer &in_data, UT_WorkBuffer &out_data, bool &store_external, void *conversion_data)

Definition at line 151 of file OP_OTLUtils.h.

Constructor & Destructor Documentation

OP_OTLUtils::OP_OTLUtils ( )

Member Function Documentation

static bool OP_OTLUtils::_convertContentsFromText ( UT_IStream is,
const UT_String dir_name,
UT_CompressionType  compression_type,
std::ostream &  os 
)
static
static bool OP_OTLUtils::_convertContentsToText ( UT_IStream is,
const UT_String dir_name,
bool  preserve_modtime,
std::ostream &  os 
)
static
static bool OP_OTLUtils::collapseLibrary ( const char *  libfile,
const char *  srcdir,
bool  createbackup = true 
)
static
static bool OP_OTLUtils::compressContents ( const UT_WorkBuffer contents_cpio,
UT_CompressionType  compression_type,
std::ostream *  os 
)
static
static bool OP_OTLUtils::convertContentsFromText ( const UT_StringArray files,
UT_StringArray out_delete_files 
)
static
static bool OP_OTLUtils::convertContentsToText ( const UT_StringArray files,
bool  preserve_modtime,
UT_StringArray out_delete_files 
)
static
static bool OP_OTLUtils::CPIOToMIME ( UT_IStream is,
std::ostream &  os,
bool  preserve_modtime,
const char *  externals_dest = nullptr 
)
static
static bool OP_OTLUtils::CPIOToMIME ( UT_IStream is,
std::ostream &  os,
bool  preserve_modtime,
const char *  externals_dest,
OTLConversionData *  conversion_data 
)
static
static bool OP_OTLUtils::expandToDirectory ( OP_OTLLibrary library,
const char *  destdir,
bool  vcsfriendly = false 
)
static
static void OP_OTLUtils::findAllMimeSections ( const char *  srcdir,
UT_StringArray allfiles,
bool  append = false 
)
static
static void OP_OTLUtils::findAllSections ( const char *  srcdir,
const char *  filename,
UT_StringArray allfiles,
bool  append = false 
)
static
static UT_CompressionType OP_OTLUtils::getCompressionFromName ( const UT_StringHolder section_name)
static
static UT_CompressionType OP_OTLUtils::getCompressionFromOptionsFile ( const UT_StringHolder options_filename)
static
static bool OP_OTLUtils::getContentsAsText ( FS_IndexFile indexfile,
UT_WorkBuffer contents_text,
bool  strip_modtime = true 
)
static
static bool OP_OTLUtils::getContentsSection ( FS_IndexFile indexFile,
UT_WorkBuffer data 
)
static
static UT_UniquePtr<UT_IStream> OP_OTLUtils::getContentsStream ( FS_IndexFile deffile,
exint uncompressed_buflen = nullptr 
)
static
static UT_UniquePtr<UT_IStream> OP_OTLUtils::getContentsStream ( UT_IStream is,
exint  nbytes,
const UT_StringHolder file_name,
exint uncompressed_buflen = nullptr 
)
static
static const ConversionList& OP_OTLUtils::getConversions ( )
inlinestatic

Definition at line 195 of file OP_OTLUtils.h.

static OP_OTLUtils* OP_OTLUtils::getInstance ( )
inlinestatic

Definition at line 42 of file OP_OTLUtils.h.

static UT_StringHolder OP_OTLUtils::getNameFromCompression ( UT_CompressionType  compression_type)
static
static bool OP_OTLUtils::getNetworkSummary ( UT_IStream is,
UT_WorkBuffer summary,
const char *  prefix = nullptr,
bool  isHipFile = false 
)
static
static bool OP_OTLUtils::getNetworkSummary ( OP_Network network,
UT_WorkBuffer summary,
const char *  prefix = nullptr,
const char *  root_name = nullptr 
)
static
static bool OP_OTLUtils::isExpandedOtl ( const char *  src)
static
static bool OP_OTLUtils::MIMEToCPIO ( UT_IStream is,
std::ostream &  os,
const char *  externals_dest = nullptr 
)
static
static bool OP_OTLUtils::MIMEToCPIO ( UT_IStream is,
std::ostream &  os,
const char *  externals_dest,
OTLConversionData *  conversion_data 
)
static
static bool OP_OTLUtils::processContentsSection ( FS_IndexFile indexFile,
const UT_String section_name 
)
static
static bool OP_OTLUtils::registerConversionFuncs ( const UT_StringHolder extension,
ConvertSectionToTextFunc  to_text,
ConvertSectionFromTextFunc  from_text 
)
static
static bool OP_OTLUtils::registerConversionFuncsEx ( const UT_StringHolder extension,
ConvertSectionToTextFuncEx  to_text,
ConvertSectionFromTextFuncEx  from_text 
)
static
static bool OP_OTLUtils::saveContentsSection ( FS_IndexFile indexFile,
const UT_WorkBuffer contents_cpio 
)
static

Member Data Documentation

const UT_StringArray OP_OTLUtils::allContentsSectionNames
static

Definition at line 242 of file OP_OTLUtils.h.

const CompressionMap OP_OTLUtils::contentsCompressionNameMap
static

Definition at line 243 of file OP_OTLUtils.h.


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