private void Clear() { cache = ""; result.Clear(); currentCharIndex = 0; currentMarkerProcessor?.Clear(); currentMarkerProcessor = null; }
private void AddRenderedField(char symbol, bool isLastSymbol) { result.Append(currentMarkerProcessor.GetCompletedField()); result.Append(isLastSymbol && !separators.Contains(symbol) ? "" : symbol.ToString()); currentMarkerProcessor = null; }
public StringProcessor(BaseMarkerProcessor marker) { markerProcessors = new[] { marker }; }
private void TryStartMarkerProcessing(char symbol) { currentMarkerProcessor = markerProcessors.FirstOrDefault(mp => mp.OpenMarker == cache.ToString()); cache = currentMarkerProcessor == null ? cache : ""; currentMarkerProcessor?.ProcessSymbol(symbol); }
private void AddRenderedField(char symbol) { result.Append(currentMarkerProcessor.GetCompletedField()); result.Append(symbol == ' ' ? " " : ""); currentMarkerProcessor = null; }