[line 58]
The writer creates nested file structures linked with 'input' commands.
The exact file generation is controlled with file path templates. Everytime a template generates a new path at the current context, an input command is created in the parent file and a new file is created instead. The actual write is performed using the basic DirectWriter (options from there apply in this writer too); Existing target files are overwritten. The encoding-setting of the generated subfiles is expected to be the same as for the initial root file item passed to the writer.
The default survey structure is written in a nested fashion where:
each survey forms a new directory in the parent folder
each surveys content go into a separate .th file
each surveys scrap data go into a separate .th2 file per survey
subsurveys are handled like that too, but the files are
linked together with input-commands.
grade definitions go into a common file 'grades.th' at the root level.
An alternative structure could be one, where you want to introduce another subfolder for therions data, so the therion files do not interfer with other files (eg. photos) stored in the default folder structure:
With this, each survey still forms a subfolder containing folders for the subsurveys. Therion data however will go into a subfolder "therion" (example assumes a survey structure like "main/sub1/sub2"):
.../main/therion/main.th -> first survey level
.../main/sub1/therion/sub1.th -> second survey level data
.../main/sub1/therion/sub1.th2 -> second survey level scraps
.../main/sub1/sub2/therion/sub2.th -> third survey level data
.../main/sub1/sub2/therion/sub2.th2 -> third survey level scraps
The lines of the File_Therion instance will be split different context collections. Local lines are written to the filepath of the given File_Therion instance. Multiline commands (e.g. 'survey', etc) are first evaulated against the matching file template. The lines are then written to the template file.
Throws: File_Therion_Exception for other errors
Throws: File_Therion_IOException in case of IO error