forked from facontidavide/PlotJuggler
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86dcc62
commit ed9d0cf
Showing
4 changed files
with
42 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
#include "error_collectors.h" | ||
#include <QMessageBox> | ||
#include <QDebug> | ||
#ifndef ERROR_COLLECTORS_H | ||
#define ERROR_COLLECTORS_H | ||
|
||
void FileErrorCollector::AddError(const std::string& filename, int line, int, | ||
const std::string& message) | ||
{ | ||
auto msg = QString("File: [%1] Line: [%2] Message: %3\n\n") | ||
.arg(QString::fromStdString(filename)) | ||
.arg(line) | ||
.arg(QString::fromStdString(message)); | ||
#include <google/protobuf/io/tokenizer.h> | ||
#include <google/protobuf/compiler/importer.h> | ||
|
||
_errors.push_back(msg); | ||
} | ||
#include <QStringList> | ||
|
||
void FileErrorCollector::AddWarning(const std::string& filename, int line, int, | ||
const std::string& message) | ||
{ | ||
auto msg = QString("Warning [%1] line %2: %3") | ||
.arg(QString::fromStdString(filename)) | ||
.arg(line) | ||
.arg(QString::fromStdString(message)); | ||
qDebug() << msg; | ||
} | ||
|
||
void IoErrorCollector::AddError(int line, google::protobuf::io::ColumnNumber, | ||
const std::string& message) | ||
class IoErrorCollector : public google::protobuf::io::ErrorCollector | ||
{ | ||
_errors.push_back( | ||
QString("Line: [%1] Message: %2\n").arg(line).arg(QString::fromStdString(message))); | ||
} | ||
public: | ||
void AddError(int line, google::protobuf::io::ColumnNumber column, | ||
const std::string& message); | ||
|
||
void AddWarning(int line, google::protobuf::io::ColumnNumber column, | ||
const std::string& message); | ||
|
||
const QStringList& errors() | ||
{ | ||
return _errors; | ||
} | ||
|
||
private: | ||
QStringList _errors; | ||
}; | ||
|
||
void IoErrorCollector::AddWarning(int line, google::protobuf::io::ColumnNumber column, | ||
const std::string& message) | ||
class FileErrorCollector : public google::protobuf::compiler::MultiFileErrorCollector | ||
{ | ||
qDebug() << QString("Line: [%1] Message: %2\n") | ||
.arg(line) | ||
.arg(QString::fromStdString(message)); | ||
} | ||
public: | ||
void AddError(const std::string& filename, int line, int, | ||
const std::string& message); | ||
|
||
void AddWarning(const std::string& filename, int line, int, | ||
const std::string& message); | ||
|
||
const QStringList& errors() | ||
{ | ||
return _errors; | ||
} | ||
|
||
private: | ||
QStringList _errors; | ||
}; | ||
|
||
#endif // ERROR_COLLECTORS_H |