12 #ifndef __FS_IndexFile__
13 #define __FS_IndexFile__
36 #define FS_SECTION_SEPARATOR UT_SECTION_SEPARATOR_CHAR
37 #define FS_SECTION_SEPARATOR_STRING UT_SECTION_SEPARATOR_STRING
72 {
return mySectionTable.contains(section) ||
73 myTempSectionTable.contains(section); }
75 {
return myTempSectionTable.contains(section); }
77 {
return mySectionTable.contains(section); }
78 int getSectionModTime(
const UT_StringRef §ion)
const;
79 int getSectionDataSize(
const UT_StringRef §ion)
const;
93 int len,
int modtime = -1);
98 int len,
int modtime = -1);
103 void mergeIndexFile(
const FS_IndexFile &file,
bool overwrite);
107 void moveSections(
int first,
int last,
int offset);
110 int getModTime()
const;
113 int64 getFileDataSize()
const;
125 FS_Section *getSection(
const UT_StringRef §ion)
const;
136 const char *source =
nullptr)
const;
139 int getNumSections()
const;
152 exint guessStreamSize()
const;
159 virtual void writeFile(std::ostream &os)
const;
163 virtual bool expandToDirectory(
const char *destdir);
164 virtual bool collapseFromDirectory(
const char *srcdir);
167 static int getCurrentTime();
170 bool isCopyProtected()
const;
173 bool isBlackBoxed()
const;
177 {
return myIsExpanded; }
179 static bool canWriteFile(
const char *
filename);
181 bool getSectionFileName(
const char *section,
194 const char *text_file_pattern =
"",
195 ConvertFunc to_text =
nullptr,
196 ConvertFunc from_text =
nullptr)
198 myFromText(from_text),
199 myBinFilePattern(bin_file_pattern),
200 myTextFilePattern(text_file_pattern)
206 myFromText =
nullptr;
207 myBinFilePattern.clear();
208 myTextFilePattern.clear();
214 return myToText ==
nullptr;
225 static bool registerConversionFuncs(
const char *bin_file_pattern,
226 const char *text_file_pattern,
228 ConvertFunc from_text);
237 exint writeHeader(std::ostream &os)
const;
239 static ConversionList &_getConversionsToText();
240 static ConversionList &_getConversionsFromText();
248 void openStream(
const UT_Options *options =
nullptr)
const;
249 void closeStream()
const;
253 bool writeSectionListFile(
const char *sectionfile);
258 void writeSection(FS_Section *section,
263 FS_Reader *getSectionReader(FS_Section *section)
const;
270 void readDirectoryIndex(
273 void readStreamIndex();
276 int getWriteFilteredSectionSize(
int index )
const;
279 void recalculateFilteredSectionSizes();
299 friend class FS_Section;
300 friend class FS_EmbeddedSection;
301 friend class FS_DiskSection;
314 friend class FS_Section;
315 friend class FS_EmbeddedSection;
316 friend class FS_DiskSection;
323 template <
typename T>
324 struct DefaultClearer;
336 static const bool clearNeedsDestruction =
false;
GT_API const UT_StringHolder filename
UT_StringHolder myTextFilePattern
static void clearConstruct(ValueT *p)
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
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.
GLsizei GLsizei GLchar * source
bool hasTempSection(const UT_StringRef §ion) const
virtual bool writeFile(const GA_Detail &g, const char *filename, const GA_SaveOptions *opts, UT_StringArray *errors) const
GLenum GLuint GLenum GLsizei const GLchar * buf
bool hasSection(const UT_StringRef §ion) const
A map of string to various well defined value types.
const UT_StringHolder & getSourceFile() const
static void clear(ValueT &v)
UT_StringHolder myBinFilePattern