Utilities used by tsv-utils applications. InputFieldReordering, BufferedOutputRange, and a several others.
Utilities in this file:
Copyright (c) 2015-2021, eBay Inc. Initially written by Jon Degenhardt
Flag used by the InputFieldReordering template.
Flag accepted by input buffering ranges to indicate if data should be read using line buffering. Input is read as soon as lines are available when line buffered mode is used.
Yes|No.newlineWasRemoved is a template parameter to throwIfWindowsNewline. A Yes value indicates the Unix newline was already removed, as might be done via std.File.byLine or similar mechanism.
Flag accepted by input buffering ranges to indicate if the header line should be read when opening a file.
ByLineSource is a class of objects produced by iterating over an ByLineSourceRange.
ByLineSourceRange is an input range that iterates over a set of input files. It provides bufferedByLine access to each file.
InputFieldReordering - Move select fields from an input line to an output array, reordering along the way.
InputSource is a class of objects produced by iterating over an InputSourceRange.
InputSourceRange is an input range that iterates over a set of input files.
BufferedOutputRangeDefaults defines the parameter defaults used by BufferedOutputRange. These can be passed to the BufferedOutputRange constructor when mixing specific setting with defaults.
bufferedByLine is a performance enhancement over std.stdio.File.byLine. It works by reading a large buffer from the input stream rather than just a single line.
byLineSourceRange is a helper function for creating new byLineSourceRange objects.
getTsvFieldValue extracts the value of a single field from a delimited text string.
inputSourceByChunk returns a range that reads either a file handle (File) or a ubyte array a chunk at a time.
inputSourceRange is a helper function for creating new InputSourceRange objects.
joinAppend performs a join operation on an input range, appending the results to an output range.
throwIfWindowsLineNewline throws an exception if the 'line' argument ends with a Windows/DOS line ending. This is used by TSV Utilities tools to detect Window/DOS line endings and terminate processing with an error message to the user.
BufferedOutputRange is a performance enhancement over writing directly to an output stream. It holds a File open for write or an OutputRange. Ouput is accumulated in an internal buffer and written to the output stream as a block.