setTimes() public méthode

To shorten the parse and quicken the speed, provide the times the user is interested in. So that it will not have to parse raw data that at the higher level the user will not be using
public setTimes ( System.DateTime start, System.DateTime end ) : void
start System.DateTime
end System.DateTime
Résultat void
Exemple #1
0
        /// <summary>
        /// Given a start and end date, return logs in a W3C_Extended object in that time interval
        /// Only return logs that have cookies within them
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns>Lines of DeSerialized logs in a given time interval</returns>
        public IEnumerable <W3C_Extended_Log> GetLines(DateTime start, DateTime end)
        {
            //iterate through our directory of files
            foreach (string logFile in _logFiles.Keys)
            {
                LogParser logParser = new LogParser();
                logParser.LogFormat = W3C_ExtendedConstants.FORMAT;
                logParser.setTimes(start, end);

                //see that its capable to read this file
                logParser.FileName = logFile;


                //once the bookmarks are created for all our files

                if (!logParser.IsCapable)
                {
                    continue;
                }

                foreach (W3C_Extended_Log log in logParser.ParseW3CFormat())
                {
                    if (log.UTCLogDateTime.CompareTo(start) >= 0 && log.UTCLogDateTime.CompareTo(end) < 0)
                    {
                        yield return(log);
                    }
                }
            }
        }
        /// <summary>
        /// Given a start and end date, return logs in a W3C_Extended object in that time interval
        /// Only return logs that have cookies within them
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns>Lines of DeSerialized logs in a given time interval</returns>
        public IEnumerable<W3C_Extended_Log> GetLines(DateTime start, DateTime end)
        {
            //iterate through our directory of files
            foreach (string logFile in _logFiles.Keys)
            {
                LogParser logParser = new LogParser();
                logParser.LogFormat = W3C_ExtendedConstants.FORMAT;
                logParser.setTimes(start, end);

                //see that its capable to read this file
                logParser.FileName = logFile;

                //once the bookmarks are created for all our files

                if (!logParser.IsCapable)
                {
                    continue;
                }

                foreach (W3C_Extended_Log log in logParser.ParseW3CFormat())
                {

                    if (log.UTCLogDateTime.CompareTo(start) >= 0 && log.UTCLogDateTime.CompareTo(end) < 0)
                    {
                        yield return log;
                    }
                }
            }
        }