12 #ifndef __FS_IndexFile__
13 #define __FS_IndexFile__
38 #define FS_SECTION_SEPARATOR UT_SECTION_SEPARATOR_CHAR
39 #define FS_SECTION_SEPARATOR_STRING UT_SECTION_SEPARATOR_STRING
40 #define FS_SECTIONFILE "Sections.list"
57 int &bad_index,
exint &max_offset);
92 {
return mySectionTable.contains(section) ||
93 myTempSectionTable.contains(section); }
95 {
return myTempSectionTable.contains(section); }
97 {
return mySectionTable.contains(section); }
98 time_t getSectionModTime(
const UT_StringRef §ion)
const;
99 int getSectionDataSize(
const UT_StringRef §ion)
const;
110 time_t modtime = time_t(-1));
113 int len, time_t modtime = time_t(-1));
118 int len, time_t modtime = time_t(-1));
121 time_t modtime = time_t(-1));
123 void mergeIndexFile(
const FS_IndexFile &file,
bool overwrite);
130 time_t getModTime()
const;
133 int64 getFileDataSize()
const;
145 FS_Section *getSection(
const UT_StringRef §ion)
const;
156 const char *source =
nullptr)
const;
159 int getNumSections()
const;
172 exint guessStreamSize()
const;
179 bool checkWriteSizeLimits()
const;
186 virtual void writeFile(std::ostream &os)
const;
190 virtual bool expandToDirectory(
const char *destdir);
191 virtual bool collapseFromDirectory(
const char *srcdir);
201 bool isCopyProtected()
const;
204 bool isBlackBoxed()
const;
208 {
return myIsExpanded; }
210 static bool canWriteFile(
const char *
filename);
212 bool getSectionFileName(
const char *section,
215 static void clearStartupCache();
227 const char *text_file_pattern =
"",
228 ConvertFunc to_text =
nullptr,
229 ConvertFunc from_text =
nullptr)
231 myFromText(from_text),
232 myBinFilePattern(bin_file_pattern),
233 myTextFilePattern(text_file_pattern)
239 myFromText =
nullptr;
240 myBinFilePattern.clear();
241 myTextFilePattern.clear();
247 return myToText ==
nullptr;
258 static bool registerConversionFuncs(
const char *bin_file_pattern,
259 const char *text_file_pattern,
261 ConvertFunc from_text);
270 exint writeHeader(std::ostream &os,
276 exint &max_offset)
const;
278 static ConversionList &_getConversionsToText();
279 static ConversionList &_getConversionsFromText();
287 void openStream(
const UT_Options *options =
nullptr)
const;
288 void closeStream()
const;
292 bool writeSectionListFile(
const char *sectionfile);
297 void writeSection(FS_Section *section,
302 FS_Reader *getSectionReader(FS_Section *section)
const;
309 void readDirectoryIndex(
312 void readStreamIndex();
315 int getWriteFilteredSectionSize(
int index )
const;
318 void recalculateFilteredSectionSizes();
337 bool myHadOversizedSection =
false;
339 friend class FS_Section;
340 friend class FS_EmbeddedSection;
341 friend class FS_DiskSection;
360 friend class FS_Section;
361 friend class FS_EmbeddedSection;
362 friend class FS_DiskSection;
369 template <
typename T>
370 struct DefaultClearer;
382 static const bool clearNeedsDestruction =
false;
GLenum GLuint GLenum GLsizei const GLchar * buf
PXL_API const char * getDescription(const ColorSpace *space)
Return the description of the color space.
GT_API const UT_StringHolder filename
UT_StringHolder myTextFilePattern
static void clearConstruct(ValueT *p)
GT_API const UT_StringHolder time
ConversionFuncs(const char *bin_file_pattern="", const char *text_file_pattern="", ConvertFunc to_text=nullptr, ConvertFunc from_text=nullptr)
bool hasRegularSection(const UT_StringRef §ion) const
static time_t getCurrentTime()
bool isExpanded() const
Tests if the index file is stored as expanded.
UT_ArrayStringMap< ConversionFuncs > ConversionList
static bool isClear(const ValueT &v)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool hasTempSection(const UT_StringRef §ion) const
GLsizei GLsizei GLchar * source
FS_IndexSizeOverflowCheck
virtual bool writeFile(const GA_Detail &g, const char *filename, const GA_SaveOptions *opts, UT_StringArray *errors) const
__hostdev__ uint64_t last(uint32_t i) const
bool hasSection(const UT_StringRef §ion) const
A map of string to various well defined value types.
const UT_StringHolder & getSourceFile() const
LeafData & operator=(const LeafData &)=delete
FS_API FS_IndexSizeOverflowCheck FSindexOverflowCheck(const exint *section_sizes, int num_sections, int &bad_index, exint &max_offset)
std::enable_if< std::is_signed< T >::value, T >::type overflowCheck(const T &a, const T &b)
Do a check for overflow on signed numbers.
static void clear(ValueT &v)
UT_StringHolder myBinFilePattern