fix(config): support protobuf 1.76 error collector
This commit is contained in:
parent
ffef60e9b8
commit
856475cb49
@ -113,14 +113,18 @@ const google::protobuf::Descriptor* descriptorForPath(const std::string& path)
|
|||||||
|
|
||||||
class TextErrorCollector final : public google::protobuf::io::ErrorCollector {
|
class TextErrorCollector final : public google::protobuf::io::ErrorCollector {
|
||||||
public:
|
public:
|
||||||
void AddError(int line, int column, const std::string& message) override
|
void RecordError(
|
||||||
|
int line,
|
||||||
|
google::protobuf::io::ColumnNumber column,
|
||||||
|
absl::string_view message) override
|
||||||
{
|
{
|
||||||
if (!errors_.empty()) errors_ += "; ";
|
if (!errors_.empty()) errors_ += "; ";
|
||||||
errors_ += "line " + std::to_string(line + 1) + ", column " +
|
errors_ += "line " + std::to_string(line + 1) + ", column " +
|
||||||
std::to_string(column + 1) + ": " + message;
|
std::to_string(column + 1) + ": " + std::string(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddWarning(int, int, const std::string&) override {}
|
void RecordWarning(
|
||||||
|
int, google::protobuf::io::ColumnNumber, absl::string_view) override {}
|
||||||
|
|
||||||
const std::string& errors() const noexcept { return errors_; }
|
const std::string& errors() const noexcept { return errors_; }
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user