12 #ifndef __OP_OTLUtils__
13 #define __OP_OTLUtils__
33 struct OTLConversionData;
59 exint *uncompressed_buflen =
nullptr);
64 exint *uncompressed_buflen =
nullptr);
73 static bool processContentsSection(
FS_IndexFile &indexFile,
80 bool vcsfriendly =
false);
82 static bool collapseLibrary(
const char *libfile,
84 bool createbackup =
true);
92 static void findAllSections(
const char *srcdir,
98 static void findAllMimeSections(
const char *srcdir,
100 bool append =
false);
103 static bool isExpandedOtl(
const char *
src);
112 bool strip_modtime =
true);
117 const char *prefix =
nullptr,
118 bool isHipFile =
false);
120 static bool getNetworkSummary(
OP_Network *network,
122 const char *prefix =
nullptr,
123 const char *root_name =
nullptr);
130 static bool compressContents(
const UT_WorkBuffer &contents_cpio,
137 bool preserve_modtime,
145 bool &store_external);
154 bool &store_external,
155 void *conversion_data);
160 void *conversion_data);
164 ConvertSectionToTextFunc myToText =
nullptr;
165 ConvertSectionFromTextFunc myFromText =
nullptr;
166 ConvertSectionToTextFuncEx myExToText =
nullptr;
167 ConvertSectionFromTextFuncEx myExFromText =
nullptr;
171 ConvertSectionFromTextFunc from_text =
nullptr,
172 ConvertSectionToTextFuncEx to_text_ex =
nullptr,
173 ConvertSectionFromTextFuncEx from_text_ex =
nullptr) :
174 myToText(to_text), myFromText(from_text),
175 myExToText(to_text_ex), myExFromText(from_text_ex)
178 ConvertSectionToTextFuncEx to_text_ex =
nullptr,
179 ConvertSectionFromTextFuncEx from_text_ex =
nullptr)
188 ConvertSectionToTextFunc to_text,
189 ConvertSectionFromTextFunc from_text);
192 ConvertSectionToTextFuncEx to_text,
193 ConvertSectionFromTextFuncEx from_text);
196 {
return getInstance()->myConversions; }
203 bool preserve_modtime,
204 const char *externals_dest =
nullptr);
207 const char *externals_dest =
nullptr);
211 bool preserve_modtime,
212 const char *externals_dest,
213 OTLConversionData *conversion_data);
216 const char *externals_dest,
217 OTLConversionData *conversion_data);
219 static bool _convertContentsToText(
UT_IStream &is,
221 bool preserve_modtime,
223 static bool _convertContentsFromText(
UT_IStream &is,
251 {
return getInstance()->myConversions; }
GT_API const UT_StringHolder filename
UT_StringMap< ConversionFuncs > ConversionList
ConversionFuncs(ConvertSectionToTextFunc to_text=nullptr, ConvertSectionFromTextFunc from_text=nullptr, ConvertSectionToTextFuncEx to_text_ex=nullptr, ConvertSectionFromTextFuncEx from_text_ex=nullptr)
static const UT_StringArray allContentsSectionNames
static OP_OTLUtils * getInstance()
static const ConversionList & getConversions()
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UT_Map< UT_StringHolder, UT_CompressionType > CompressionMap
static ConversionFuncs CreateConversionFuncsEx(ConvertSectionToTextFuncEx to_text_ex=nullptr, ConvertSectionFromTextFuncEx from_text_ex=nullptr)
static const CompressionMap contentsCompressionNameMap
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept