public StringSlice JSON_UNESCAPE(StringSlice str) { return(new StringSlice(Regex.Unescape(str.Value))); }
public MultilineText(StringSlice txt) { this.text = txt; }
public StringSlice CONCAT(StringSlice s1, string s2) { return(StringSlice.Concat(s1, new StringSlice(s2))); }
public StringSlice CSV_UNESCAPE(StringSlice str, char quoteChar) { return(new StringSlice(base.CSV_UNESCAPE(str.Value, quoteChar))); }
public static int EnumLines(StringSlice txt, Func <StringSlice, int, bool> callback) { int currentIdx = 0; bool lastWasR = false; int currentStart = 0; for (int i = 0; i < txt.Length; ++i) { bool yieldLine = false; int newCurrentStart = currentStart; int currentEnd = 0; switch (txt[i]) { case '\r': if (lastWasR) { yieldLine = true; newCurrentStart = i; currentEnd = i - 1; } lastWasR = true; break; case '\n': yieldLine = true; if (lastWasR) { currentEnd = i - 1; } else { currentEnd = i; } lastWasR = false; newCurrentStart = i + 1; break; default: if (lastWasR) { yieldLine = true; newCurrentStart = i; currentEnd = i - 1; } lastWasR = false; break; } if (yieldLine) { if (callback != null) { if (!callback(txt.SubString(currentStart, currentEnd - currentStart), currentIdx)) { return(currentIdx + 1); } } ++currentIdx; currentStart = newCurrentStart; } } if (lastWasR) { if (callback != null) { if (!callback(txt.SubString(currentStart, txt.Length - currentStart - 1), currentIdx)) { return(currentIdx + 1); } } ++currentIdx; } else { if (callback != null) { callback(txt.SubString(currentStart, txt.Length - currentStart), currentIdx); } } return(currentIdx + 1); }
void IMessage.SetRawText(StringSlice rawText) { this.rawText = rawText; }
public int TO_INT(StringSlice str) { return(ParseInt(str.Buffer, str.StartIndex, str.Length)); }
void IFieldsProcessor.SetInputField(int idx, StringSlice value) { builder.SetInputFieldByIndex(idx, value); }
public bool EMPTY(StringSlice str) { return(str.IsEmpty); }
public int TO_INT(StringSlice str, int idx, int len) { StringSlice tmp = str.SubString(idx, len); return(ParseInt(tmp.Buffer, tmp.StartIndex, tmp.Length)); }
public int HEX_TO_INT(StringSlice str) { return(int.Parse(str.ToString(), NumberStyles.HexNumber)); }
public DateTime TICKS_TO_DATETIME(StringSlice ticksStr) { return(new DateTime(long.Parse(ticksStr.Value), DateTimeKind.Unspecified)); }
public StringSlice CONCAT(string s1, StringSlice s2) { return(StringSlice.Concat(new StringSlice(s1), s2)); }
public IThread GetThread(StringSlice id) { return(fakeThread ?? threads.GetThread(id)); }
public StringSlice TRIM(StringSlice str) { return(str.Trim()); }
internal void SetRawText(StringSlice value) { rawText = value; }
public DateTime TO_DATETIME(StringSlice value, string format, string culture) { return(TO_DATETIME(value.Value, format, culture)); }
public MultilineText(StringSlice txt, bool isMultiline) { this.text = txt; this.textIsMultiline = isMultiline; }
public int PARSE_YEAR(StringSlice year) { int y = TO_INT(year); return(PARSE_YEAR_impl(y)); }
public static int GetFirstLineLength(StringSlice s) { return(s.IndexOfAny(newLineChars)); }
public StringSlice MATCH(StringSlice value, string pattern) { return(MATCH(value, pattern, 0)); }
public MessageBase(long position, long endPosition, IThread t, MessageTimestamp time, StringSlice rawText = new StringSlice()) { if (endPosition < position) { throw new ArgumentException("bad message positions"); } this.thread = t; this.time = time; this.position = position; this.endPosition = endPosition; this.rawText = rawText; }
public StringSlice CONCAT(StringSlice s1, StringSlice s2) { return(StringSlice.Concat(s1, s2)); }