SplitOutputFiles

A SplitOutputFiles struct holds a collection of output files.

This struct manages a collection of output files used when writing to multiple files at once. This includes constructing filenames, opening and closing files, and writing data and header lines.

Both random assignment (splitLinesRandomly) and random assignment by key (splitLinesByKey) use a SplitOutputFiles struct to manage output files.

The main properties of the output file set are specified in the constuctor. The exception is the header line. This is not known until the first input file is read, so it is specified in a separate 'setHeader' call.

Individual output files are written to based on their zero-based index in the output collection. The caller selects the output file number to write to and calls 'writeDataLine' to write a line. The header is written if needed.

Constructors

this
this(uint numFiles, string dir, string filePrefix, string fileSuffix, uint fileDigitWidth, bool writeHeaders, uint maxOpenFiles, string header)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

checkIfFilesExist
string checkIfFilesExist()
Undocumented in source. Be warned that the author may not have intended to support it.
writeDataLine
void writeDataLine(uint fileNum, char[] data)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

OutputFile
struct OutputFile
Undocumented in source.

Meta