예제 #1
0
        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);
        }
예제 #2
0
            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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
 public override long FindBackward(long start, ISearchData searchData)
 {
     return(FindBackwardInternal(start, searchData, BufferSearch16.Instance));
 }
예제 #7
0
 public abstract IFlightData[] GetList(IFlightData args, ISearchData searchData);
        public SearchBusinessModule(ISearchData searchData)
		{
			this.SearchData = searchData;
        }
예제 #9
0
 public SearchBusinessModule(ISearchData searchData)
 {
     this.SearchData = searchData;
 }
예제 #10
0
 public virtual long FindForward(long start, ISearchData searchData)
 {
     return(FindForwardInternal(start, searchData, BufferSearch.Instance));
 }
예제 #11
0
 public ResultBuilder(IDatabase database, ISearchData searchData)
 {
     _database   = database;
     _searchData = searchData;
 }