コード例 #1
0
        public static Maybe <InternetCaptureEntry> Parse(string csvLine)
        {
            var tokens = csvLine.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            if (tokens.Length < 8)
            {
                return(Maybe.None <InternetCaptureEntry>());
            }

            return
                (tokens[0].TryParseDateTime()
                 .Bind(timestamp => IP.TryParse(tokens[3])
                       .Bind(sourceIp => IP.TryParse(tokens[6])
                             .Map(destionationIp => new InternetCaptureEntry(sourceIp, destionationIp, timestamp)))));
        }
コード例 #2
0
 public InternetCaptureEntry(IP sourceIp, IP destinationIp, DateTime timestamp)
 {
     SourceIP      = sourceIp;
     DestinationIP = destinationIp;
     Timestamp     = timestamp;
 }