Exemple #1
0
        private static DBData ParsarBanco(FileInfo banco)
        {
            DBData dados = new DBData();

            if (banco.Exists)
            {
                using (var reader = banco.OpenText()) {
                    string rawLine;
                    while ((rawLine = reader.ReadLine()) != null)
                    {
                        dados.Add(Entrada.Parsar(rawLine));
                    }
                }
            }
            return(dados);
        }
Exemple #2
0
 public LogEvent(string fromLog)
 {
     if (fromLog.StartsWith("Checkpoint"))
     {
         Type = LogEventTypes.Checkpoint;
     }
     else
     {
         var regex = Regex.Match(fromLog, "(\\S*) (\\S*): (\\S*) ?(.*)?");
         Id = regex.Groups[2].Value;
         if (!Enum.TryParse(regex.Groups[3].Value, out _LogEventTypes))
         {
             throw new Exception($"Evento '{regex.Groups[3].Value}' do log não foi reconhecido");
         }
         if (regex.Groups[4].Success && regex.Groups[4].Value.Length > 0)
         {
             Data = Entrada.Parsar(regex.Groups[4].Value);
         }
     }
 }