Beispiel #1
0
Error parseBibtexLog(const FilePath& logFilePath, LogEntries* pLogEntries)
{
   boost::regex re("^(.*)---line ([0-9]+) of file (.*)$");

   // get the lines
   std::vector<std::string> lines;
   Error error = ::core::readStringVectorFromFile(logFilePath, &lines, false);
   if (error)
      return error;

   // look for error messages
   for (std::vector<std::string>::const_iterator it = lines.begin();
        it != lines.end();
        it++)
   {
      boost::smatch match;
      if (regex_match(*it, match, re))
      {
         pLogEntries->push_back(
               LogEntry(
                     logFilePath,
                     (it - lines.begin()) + 1,
                     LogEntry::Error,
                     texFilePath(match[3], logFilePath.parent()),
                     boost::lexical_cast<int>(match[2]),
                     match[1]));
      }
   }

   return Success();
}
Beispiel #2
0
LogEntry fromBibtexMatch(const boost::smatch& match,
                         const FilePath& compileDir)
{
   return LogEntry(LogEntry::Error,
                   texFilePath(match[3], compileDir),
                   boost::lexical_cast<int>(match[2]),
                   match[1]);
}