error_collectors.cpp
Go to the documentation of this file.
1 #include "error_collectors.h"
2 #include <QMessageBox>
3 #include <QDebug>
4 
5 void FileErrorCollector::AddError(const std::string& filename, int line, int,
6  const std::string& message)
7 {
8  auto msg = QString("File: [%1] Line: [%2] Message: %3\n\n")
9  .arg(QString::fromStdString(filename))
10  .arg(line)
11  .arg(QString::fromStdString(message));
12 
13  _errors.push_back(msg);
14 }
15 
16 void FileErrorCollector::AddWarning(const std::string& filename, int line, int,
17  const std::string& message)
18 {
19  auto msg = QString("Warning [%1] line %2: %3")
20  .arg(QString::fromStdString(filename))
21  .arg(line)
22  .arg(QString::fromStdString(message));
23  qDebug() << msg;
24 }
25 
26 void IoErrorCollector::AddError(int line, google::protobuf::io::ColumnNumber,
27  const std::string& message)
28 {
29  _errors.push_back(
30  QString("Line: [%1] Message: %2\n").arg(line).arg(QString::fromStdString(message)));
31 }
32 
33 void IoErrorCollector::AddWarning(int line, google::protobuf::io::ColumnNumber column,
34  const std::string& message)
35 {
36  qDebug() << QString("Line: [%1] Message: %2\n")
37  .arg(line)
38  .arg(QString::fromStdString(message));
39 }
FileErrorCollector::_errors
QStringList _errors
Definition: error_collectors.h:42
IoErrorCollector::_errors
QStringList _errors
Definition: error_collectors.h:24
arg
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
Definition: core.h:1875
IoErrorCollector::AddError
void AddError(int line, google::protobuf::io::ColumnNumber column, const std::string &message) override
Definition: error_collectors.cpp:26
mqtt_test_proto.msg
msg
Definition: mqtt_test_proto.py:43
IoErrorCollector::AddWarning
void AddWarning(int line, google::protobuf::io::ColumnNumber column, const std::string &message) override
Definition: error_collectors.cpp:33
FileErrorCollector::AddError
void AddError(const std::string &filename, int line, int, const std::string &message) override
Definition: error_collectors.cpp:5
FileErrorCollector::AddWarning
void AddWarning(const std::string &filename, int line, int, const std::string &message) override
Definition: error_collectors.cpp:16
error_collectors.h


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44