public RawSegment(string value, Delimiters delims, LoopsList parentLoop, SegmentDefinition def) { FieldValues = new List <List <string> >(); ParsedValue = value; delimiters = delims; ParentLoopsList = parentLoop; ParentLoop = parentLoop?.Last(); DefiningSegment = def; var firstSplit = value.Split(delims.Element); foreach (string s in firstSplit) { var subs = new List <string>(); if (s.Contains(delims.SubElement)) { subs = s.Split(delims.SubElement).ToList(); } else { subs.Add(s); } FieldValues.Add(subs); } }
public baseStdSegment CreateInstance(string value, Delimiters delims, LoopsList parentLoop) { var sg = (baseStdSegment)Activator.CreateInstance(SegmentType); sg.Prep(value, parentLoop, delims, this); //RawSegments.Add(sg.rawSegment); return(sg); }
public void Prep(string value, LoopsList parentLoop, Delimiters delims, SegmentDefinition def) { ParentLoops = parentLoop; Delimiter = delims; DefinedSeg = def; ParentLoop = ParentLoops?.Last(); rawSegment = new RawSegment(value, Delimiter, ParentLoops, DefinedSeg); }
public baseStdSegment(string value, LoopsList parentLoop, Delimiters delims, SegmentDefinition def) { Prep(value, parentLoop, delims, def); }