diff options
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface.h')
-rw-r--r-- | src/google/protobuf/compiler/command_line_interface.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h index 7d3037a9..acd2f84a 100644 --- a/src/google/protobuf/compiler/command_line_interface.h +++ b/src/google/protobuf/compiler/command_line_interface.h @@ -38,13 +38,14 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ #define GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ -#include <google/protobuf/stubs/common.h> -#include <google/protobuf/stubs/hash.h> -#include <string> -#include <vector> #include <map> #include <set> +#include <string> +#include <unordered_map> #include <utility> +#include <vector> + +#include <google/protobuf/stubs/common.h> namespace google { namespace protobuf { @@ -72,10 +73,10 @@ class DiskSourceTree; // importer.h // then write a main() procedure like this: // // int main(int argc, char* argv[]) { -// google::protobuf::compiler::CommandLineInterface cli; +// proto2::compiler::CommandLineInterface cli; // // // Support generation of C++ source and headers. -// google::protobuf::compiler::cpp::CppGenerator cpp_generator; +// proto2::compiler::cpp::CppGenerator cpp_generator; // cli.RegisterGenerator("--cpp_out", &cpp_generator, // "Generate C++ source and header."); // @@ -206,17 +207,21 @@ class LIBPROTOC_EXPORT CommandLineInterface { class ErrorPrinter; class GeneratorContextImpl; class MemoryOutputStream; - typedef hash_map<string, GeneratorContextImpl*> GeneratorContextMap; + typedef std::unordered_map<string, GeneratorContextImpl*> GeneratorContextMap; // Clear state from previous Run(). void Clear(); + // Remaps the proto file so that it is relative to one of the ddirectories + // in proto_path_. Returns false if an error occurred. + bool MakeProtoProtoPathRelative(DiskSourceTree* source_tree, string* proto); + // Remaps each file in input_files_ so that it is relative to one of the - // directories in proto_path_. Returns false if an error occurred. This - // is only used if inputs_are_proto_path_relative_ is false. + // directories in proto_path_. Returns false if an error occurred. bool MakeInputsBeProtoPathRelative( DiskSourceTree* source_tree); + // Return status for ParseArguments() and InterpretArgument(). enum ParseArgumentStatus { PARSE_ARGUMENT_DONE_AND_CONTINUE, @@ -430,6 +435,6 @@ class LIBPROTOC_EXPORT CommandLineInterface { } // namespace compiler } // namespace protobuf - } // namespace google + #endif // GOOGLE_PROTOBUF_COMPILER_COMMAND_LINE_INTERFACE_H__ |