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"
75 {
return mySectionTable.contains(section) ||
76 myTempSectionTable.contains(section); }
78 {
return myTempSectionTable.contains(section); }
80 {
return mySectionTable.contains(section); }
81 time_t getSectionModTime(
const UT_StringRef §ion)
const;
82 int getSectionDataSize(
const UT_StringRef §ion)
const;
93 time_t modtime = time_t(-1));
96 int len, time_t modtime = time_t(-1));
101 int len, time_t modtime = time_t(-1));
104 time_t modtime = time_t(-1));
106 void mergeIndexFile(
const FS_IndexFile &file,
bool overwrite);
113 time_t getModTime()
const;
116 int64 getFileDataSize()
const;
128 FS_Section *getSection(
const UT_StringRef §ion)
const;
139 const char *source =
nullptr)
const;
142 int getNumSections()
const;
155 exint guessStreamSize()
const;
162 virtual void writeFile(std::ostream &os)
const;
166 virtual bool expandToDirectory(
const char *destdir);
167 virtual bool collapseFromDirectory(
const char *srcdir);
177 bool isCopyProtected()
const;
180 bool isBlackBoxed()
const;
184 {
return myIsExpanded; }
186 static bool canWriteFile(
const char *
filename);
188 bool getSectionFileName(
const char *section,
191 static void clearStartupCache();
203 const char *text_file_pattern =
"",
204 ConvertFunc to_text =
nullptr,
205 ConvertFunc from_text =
nullptr)
207 myFromText(from_text),
208 myBinFilePattern(bin_file_pattern),
209 myTextFilePattern(text_file_pattern)
215 myFromText =
nullptr;
216 myBinFilePattern.clear();
217 myTextFilePattern.clear();
223 return myToText ==
nullptr;
234 static bool registerConversionFuncs(
const char *bin_file_pattern,
235 const char *text_file_pattern,
237 ConvertFunc from_text);
246 exint writeHeader(std::ostream &os,
249 static ConversionList &_getConversionsToText();
250 static ConversionList &_getConversionsFromText();
258 void openStream(
const UT_Options *options =
nullptr)
const;
259 void closeStream()
const;
263 bool writeSectionListFile(
const char *sectionfile);
268 void writeSection(FS_Section *section,
273 FS_Reader *getSectionReader(FS_Section *section)
const;
280 void readDirectoryIndex(
283 void readStreamIndex();
286 int getWriteFilteredSectionSize(
int index )
const;
289 void recalculateFilteredSectionSizes();
309 friend class FS_Section;
310 friend class FS_EmbeddedSection;
311 friend class FS_DiskSection;
330 friend class FS_Section;
331 friend class FS_EmbeddedSection;
332 friend class FS_DiskSection;
339 template <
typename T>
340 struct DefaultClearer;
352 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
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
static void clear(ValueT &v)
UT_StringHolder myBinFilePattern