protected long FindForwardInternal(long start, ISearchData searchData, IBufferSearch bufferSearch) { if (start < 0) { return(-1); } long pos = start; while (pos < StreamLength) { Buffer b = GetContainingBuffer(pos); if (b != null) { if (bufferSearch.TryFindAnyForward(b, pos, searchData, out long foundAt)) { return(foundAt); } pos = b.End; } else { FillBuffer(pos); } } return(-1); }
public bool TryFindAnyBackward(Buffer buffer, long pos, ISearchData searchData, out long foundAt) { if (!(searchData is Buffer.InternalSearchData)) { throw new ArgumentException($"Type of '{nameof(searchData)}' should be '{typeof(Buffer.InternalSearchData).Name}'"); } return(buffer.TryFindAnyBackward(pos, (Buffer.InternalSearchData)searchData, out foundAt)); }
public IFlightBooking[] Retrieve(IFlightBookingData args, ISearchData searchData) { IFlightBookingData[] flightBookingDatas = proxyFlightBooking_.GetList(args, searchData); IFlightBooking[] flightBookings = new IFlightBooking[flightBookingDatas.Length]; for (int i = 0; i < flightBookings.Length; ++i) { flightBookings[i] = new FlightBookingImpl(proxyFlightBooking_, flightBookingDatas[i]); } return(flightBookings); }
public IFlight[] Retrieve(IFlightData data, ISearchData searchData) { IFlightData[] flightDatas = proxyFlight_.GetList(data, searchData); IFlight[] flights = new IFlight[flightDatas.Length]; for (int i = 0; i < flights.Length; ++i) { flights[i] = new FlightImpl(proxyFlight_, flightDatas[i]); } return(flights); }
void InitNewLineMarker() { int codePointSize = blockReader.MinCodePointSize; List <uint> lMarkers = new List <uint>(); foreach (uint cPoint in lineEndings.CodePoints) { byte[] bytes = encoding.GetBytes(new char[] { (char)cPoint }); uint m = 0; for (int i = bytes.Length - codePointSize; i < bytes.Length; ++i) { m = (m << 8) | bytes[i]; } lMarkers.Add(m); } searchData = blockReader.CreateSearchData(lMarkers); }
public override long FindBackward(long start, ISearchData searchData) { return(FindBackwardInternal(start, searchData, BufferSearch16.Instance)); }
public abstract IFlightData[] GetList(IFlightData args, ISearchData searchData);
public SearchBusinessModule(ISearchData searchData) { this.SearchData = searchData; }
public virtual long FindForward(long start, ISearchData searchData) { return(FindForwardInternal(start, searchData, BufferSearch.Instance)); }
public ResultBuilder(IDatabase database, ISearchData searchData) { _database = database; _searchData = searchData; }