Index: third_party/protobuf/src/google/protobuf/compiler/importer.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/importer.h b/third_party/protobuf/src/google/protobuf/compiler/importer.h |
index 7a62fa0e66bc48d4d468dff4e2f83ff76d0685c6..cc8fcc39b09c7d55d1940a3e66c1d517c91a418e 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/importer.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/importer.h |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -121,6 +121,12 @@ class LIBPROTOBUF_EXPORT SourceTreeDescriptorDatabase : public DescriptorDatabas |
ErrorLocation location, |
const string& message); |
+ virtual void AddWarning(const string& filename, |
+ const string& element_name, |
+ const Message* descriptor, |
+ ErrorLocation location, |
+ const string& message); |
+ |
private: |
SourceTreeDescriptorDatabase* owner_; |
}; |
@@ -166,6 +172,9 @@ class LIBPROTOBUF_EXPORT Importer { |
return &pool_; |
} |
+ void AddUnusedImportTrackFile(const string& file_name); |
+ void ClearUnusedImportTrackFiles(); |
+ |
private: |
SourceTreeDescriptorDatabase database_; |
DescriptorPool pool_; |
@@ -185,6 +194,9 @@ class LIBPROTOBUF_EXPORT MultiFileErrorCollector { |
virtual void AddError(const string& filename, int line, int column, |
const string& message) = 0; |
+ virtual void AddWarning(const string& filename, int line, int column, |
+ const string& message) {} |
+ |
private: |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultiFileErrorCollector); |
}; |
@@ -204,6 +216,13 @@ class LIBPROTOBUF_EXPORT SourceTree { |
// contain "." or ".." components. |
virtual io::ZeroCopyInputStream* Open(const string& filename) = 0; |
+ // If Open() returns NULL, calling this method immediately will return an |
+ // description of the error. |
+ // Subclasses should implement this method and return a meaningful value for |
+ // better error reporting. |
+ // TODO(xiaofeng): change this to a pure virtual function. |
+ virtual string GetLastErrorMessage(); |
+ |
private: |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SourceTree); |
}; |
@@ -273,7 +292,9 @@ class LIBPROTOBUF_EXPORT DiskSourceTree : public SourceTree { |
bool VirtualFileToDiskFile(const string& virtual_file, string* disk_file); |
// implements SourceTree ------------------------------------------- |
- io::ZeroCopyInputStream* Open(const string& filename); |
+ virtual io::ZeroCopyInputStream* Open(const string& filename); |
+ |
+ virtual string GetLastErrorMessage(); |
private: |
struct Mapping { |
@@ -285,6 +306,7 @@ class LIBPROTOBUF_EXPORT DiskSourceTree : public SourceTree { |
: virtual_path(virtual_path_param), disk_path(disk_path_param) {} |
}; |
vector<Mapping> mappings_; |
+ string last_error_message_; |
// Like Open(), but returns the on-disk path in disk_file if disk_file is |
// non-NULL and the file could be successfully opened. |