diff options
Diffstat (limited to 'src/google/protobuf/descriptor_database.cc')
-rw-r--r-- | src/google/protobuf/descriptor_database.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/google/protobuf/descriptor_database.cc b/src/google/protobuf/descriptor_database.cc index ba85ef13..1f5ba480 100644 --- a/src/google/protobuf/descriptor_database.cc +++ b/src/google/protobuf/descriptor_database.cc @@ -214,6 +214,17 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::FindAllExtensionNumbers( } template <typename Value> +void SimpleDescriptorDatabase::DescriptorIndex<Value>::FindAllFileNames( + std::vector<string>* output) { + output->resize(by_name_.size()); + int i = 0; + for (const auto& kv : by_name_) { + (*output)[i] = kv.first; + i++; + } +} + +template <typename Value> typename std::map<string, Value>::iterator SimpleDescriptorDatabase::DescriptorIndex<Value>::FindLastLessOrEqual( const string& name) { @@ -293,6 +304,11 @@ bool SimpleDescriptorDatabase::FindAllExtensionNumbers( } +bool SimpleDescriptorDatabase::FindAllFileNames(std::vector<string>* output) { + index_.FindAllFileNames(output); + return true; +} + bool SimpleDescriptorDatabase::MaybeCopy(const FileDescriptorProto* file, FileDescriptorProto* output) { if (file == NULL) return false; |