diff options
Diffstat (limited to 'src/google/protobuf/compiler/mock_code_generator.h')
-rw-r--r-- | src/google/protobuf/compiler/mock_code_generator.h | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/google/protobuf/compiler/mock_code_generator.h b/src/google/protobuf/compiler/mock_code_generator.h index cdd9138c..e6370b34 100644 --- a/src/google/protobuf/compiler/mock_code_generator.h +++ b/src/google/protobuf/compiler/mock_code_generator.h @@ -41,7 +41,9 @@ namespace google { namespace protobuf { class FileDescriptor; } // namespace protobuf +} // namespace google +namespace google { namespace protobuf { namespace compiler { @@ -72,7 +74,7 @@ namespace compiler { // that can later be verified with CheckGeneratedAnnotations. class MockCodeGenerator : public CodeGenerator { public: - MockCodeGenerator(const string& name); + MockCodeGenerator(const std::string& name); virtual ~MockCodeGenerator(); // Expect (via gTest) that a MockCodeGenerator with the given name was called @@ -82,49 +84,49 @@ class MockCodeGenerator : public CodeGenerator { // should have inserted lines into this file. // |parsed_file_list| is a comma-separated list of names of the files // that are being compiled together in this run. - static void ExpectGenerated(const string& name, - const string& parameter, - const string& insertions, - const string& file, - const string& first_message_name, - const string& parsed_file_list, - const string& output_directory); + static void ExpectGenerated(const std::string& name, + const std::string& parameter, + const std::string& insertions, + const std::string& file, + const std::string& first_message_name, + const std::string& parsed_file_list, + const std::string& output_directory); // Checks that the correct text ranges were annotated by the // MockCodeGenerator_Annotate directive. - static void CheckGeneratedAnnotations(const string& name, - const string& file, - const string& output_directory); + static void CheckGeneratedAnnotations(const std::string& name, + const std::string& file, + const std::string& output_directory); // Get the name of the file which would be written by the given generator. - static string GetOutputFileName(const string& generator_name, + static std::string GetOutputFileName(const std::string& generator_name, const FileDescriptor* file); - static string GetOutputFileName(const string& generator_name, - const string& file); + static std::string GetOutputFileName(const std::string& generator_name, + const std::string& file); // implements CodeGenerator ---------------------------------------- virtual bool Generate(const FileDescriptor* file, - const string& parameter, + const std::string& parameter, GeneratorContext* context, - string* error) const; + std::string* error) const; private: - string name_; + std::string name_; - static string GetOutputFileContent(const string& generator_name, - const string& parameter, + static std::string GetOutputFileContent(const std::string& generator_name, + const std::string& parameter, const FileDescriptor* file, GeneratorContext *context); - static string GetOutputFileContent(const string& generator_name, - const string& parameter, - const string& file, - const string& parsed_file_list, - const string& first_message_name); + static std::string GetOutputFileContent(const std::string& generator_name, + const std::string& parameter, + const std::string& file, + const std::string& parsed_file_list, + const std::string& first_message_name); }; } // namespace compiler } // namespace protobuf - } // namespace google + #endif // GOOGLE_PROTOBUF_COMPILER_MOCK_CODE_GENERATOR_H__ |