Class CsvSegmenter
- Namespace
- Hi.Numerical.CsvParsers
- Assembly
- HiMech.dll
Segments a CSV stream for the SoftNcRunner pipeline. Consumes the first IndexedFileLine as the title row (populating TitleList and registering the residual columns as step variables via StepPropertyAccessDictionaryDependency, see RegisterStepVariables(List<INcDependency>, NcDiagnosticProgress)), then yields each subsequent line as a one-line Sentence for CsvRowSyntax to parse.
public class CsvSegmenter : ISegmenter, IToXElement
- Inheritance
-
CsvSegmenter
- Implements
- Inherited Members
- Extension Methods
Properties
Name
Display name of this segmenter.
public string Name { get; }
Property Value
TitleList
Column titles parsed from the first row of the most recent GetSentences(LazyLinkedList<IndexedFileLine>, List<INcDependency>, NcDiagnosticProgress) invocation. Quote- and whitespace-trimmed to match the convention established in the legacy CsvRunner. Reset on each new call so per-file headers stay accurate across multi-file sessions.
public List<string> TitleList { get; }
Property Value
XName
XML element name for Generators registration.
public static string XName { get; }
Property Value
Methods
GetSentences(LazyLinkedList<IndexedFileLine>, List<INcDependency>, NcDiagnosticProgress)
Segments the indexed file lines into Sentences.
public IEnumerable<Sentence> GetSentences(LazyLinkedList<IndexedFileLine> indexedFileLines, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
indexedFileLinesLazyLinkedList<IndexedFileLine>The lazy linked list of indexed file lines.
ncDependencyListList<INcDependency>Dependency list of the owning runner; segmenters that consume header rows (e.g. CsvSegmenter) read host-wired dependencies from here. May be null in lightweight test fixtures — implementations that need a dependency must null-check.
ncDiagnosticProgressNcDiagnosticProgressDiagnostic progress reporter.
Returns
- IEnumerable<Sentence>
A sequence of Sentences.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory
ToXElement()
Get the XElement to represent the object.
public XElement ToXElement()