public CreateParserParams( long startPosition, FileRange.Range?range = null, MessagesParserFlag flags = MessagesParserFlag.Default, MessagesParserDirection direction = MessagesParserDirection.Forward, Func <IMessagesPostprocessor> postprocessor = null ) { this.StartPosition = startPosition; this.Range = range; this.Flags = flags; this.Direction = direction; this.PostprocessorsFactory = postprocessor; }
protected static MakeMessageFlags ParserFlagsToMakeMessageFlags(MessagesParserFlag flags) { MakeMessageFlags ret = MakeMessageFlags.Default; if ((flags & MessagesParserFlag.HintMessageTimeIsNotNeeded) != 0) { ret |= MakeMessageFlags.HintIgnoreTime; } if ((flags & MessagesParserFlag.HintMessageContentIsNotNeeed) != 0) { ret |= (MakeMessageFlags.HintIgnoreBody | MakeMessageFlags.HintIgnoreEntryType | MakeMessageFlags.HintIgnoreSeverity | MakeMessageFlags.HintIgnoreThread); } return(ret); }
public CreateParserParams( long startPosition, FileRange.Range?range = null, MessagesParserFlag flags = MessagesParserFlag.Default, MessagesParserDirection direction = MessagesParserDirection.Forward, Func <IMessagesPostprocessor> postprocessor = null, CancellationToken?cancellation = null ) { this.StartPosition = startPosition; this.Range = range; this.Flags = flags; this.Direction = direction; this.PostprocessorsFactory = postprocessor; this.Cancellation = cancellation.GetValueOrDefault(CancellationToken.None); }
static public IMessage ReadNearestMessage(IPositionedMessagesReader reader, long position, MessagesParserFlag flags) { using (IPositionedMessagesParser parser = reader.CreateParser(new CreateParserParams(position, null, flags, MessagesParserDirection.Forward))) { IMessage ret = parser.ReadNext(); return(ret); } }
static public async Task <IMessage> ReadNearestMessage(IPositionedMessagesReader reader, long position, MessagesParserFlag flags) { return(await DisposableAsync.Using(await reader.CreateParser(new CreateParserParams(position, null, flags, MessagesParserDirection.Forward)), async parser => { IMessage ret = await parser.ReadNext(); return ret; })); }