12 #ifndef __FS_IndexFile__
13 #define __FS_IndexFile__
37 #define FS_SECTION_SEPARATOR UT_SECTION_SEPARATOR_CHAR
38 #define FS_SECTION_SEPARATOR_STRING UT_SECTION_SEPARATOR_STRING
39 #define FS_SECTIONFILE "Sections.list"
74 {
return mySectionTable.contains(section) ||
75 myTempSectionTable.contains(section); }
77 {
return myTempSectionTable.contains(section); }
79 {
return mySectionTable.contains(section); }
80 time_t getSectionModTime(
const UT_StringRef §ion)
const;
81 int getSectionDataSize(
const UT_StringRef §ion)
const;
92 time_t modtime = time_t(-1));
95 int len, time_t modtime = time_t(-1));
100 int len, time_t modtime = time_t(-1));
103 time_t modtime = time_t(-1));
105 void mergeIndexFile(
const FS_IndexFile &file,
bool overwrite);
112 time_t getModTime()
const;
115 int64 getFileDataSize()
const;
127 FS_Section *getSection(
const UT_StringRef §ion)
const;
138 const char *source =
nullptr)
const;
141 int getNumSections()
const;
154 exint guessStreamSize()
const;
161 virtual void writeFile(std::ostream &os)
const;
165 virtual bool expandToDirectory(
const char *destdir);
166 virtual bool collapseFromDirectory(
const char *srcdir);
176 bool isCopyProtected()
const;
179 bool isBlackBoxed()
const;
183 {
return myIsExpanded; }
185 static bool canWriteFile(
const char *
filename);
187 bool getSectionFileName(
const char *section,
200 const char *text_file_pattern =
"",
201 ConvertFunc to_text =
nullptr,
202 ConvertFunc from_text =
nullptr)
204 myFromText(from_text),
205 myBinFilePattern(bin_file_pattern),
206 myTextFilePattern(text_file_pattern)
212 myFromText =
nullptr;
213 myBinFilePattern.clear();
214 myTextFilePattern.clear();
220 return myToText ==
nullptr;
231 static bool registerConversionFuncs(
const char *bin_file_pattern,
232 const char *text_file_pattern,
234 ConvertFunc from_text);
243 exint writeHeader(std::ostream &os)
const;
245 static ConversionList &_getConversionsToText();
246 static ConversionList &_getConversionsFromText();
254 void openStream(
const UT_Options *options =
nullptr)
const;
255 void closeStream()
const;
259 bool writeSectionListFile(
const char *sectionfile);
264 void writeSection(FS_Section *section,
269 FS_Reader *getSectionReader(FS_Section *section)
const;
276 void readDirectoryIndex(
279 void readStreamIndex();
282 int getWriteFilteredSectionSize(
int index )
const;
285 void recalculateFilteredSectionSizes();
305 friend class FS_Section;
306 friend class FS_EmbeddedSection;
307 friend class FS_DiskSection;
326 friend class FS_Section;
327 friend class FS_EmbeddedSection;
328 friend class FS_DiskSection;
335 template <
typename T>
336 struct DefaultClearer;
348 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