aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/code_generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/code_generator.h')
-rw-r--r--src/google/protobuf/compiler/code_generator.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h
index 4c2b3ee1..b1eb61ac 100644
--- a/src/google/protobuf/compiler/code_generator.h
+++ b/src/google/protobuf/compiler/code_generator.h
@@ -43,6 +43,8 @@
#include <vector>
#include <utility>
+#include <google/protobuf/port_def.inc>
+
namespace google {
namespace protobuf {
@@ -61,7 +63,7 @@ class GeneratorContext;
// The abstract interface to a class which generates code implementing a
// particular proto file in a particular language. A number of these may
// be registered with CommandLineInterface to support various languages.
-class LIBPROTOC_EXPORT CodeGenerator {
+class PROTOC_EXPORT CodeGenerator {
public:
inline CodeGenerator() {}
virtual ~CodeGenerator();
@@ -78,9 +80,9 @@ class LIBPROTOC_EXPORT CodeGenerator {
// Returns true if successful. Otherwise, sets *error to a description of
// the problem (e.g. "invalid parameter") and returns false.
virtual bool Generate(const FileDescriptor* file,
- const string& parameter,
+ const std::string& parameter,
GeneratorContext* generator_context,
- string* error) const = 0;
+ std::string* error) const = 0;
// Generates code for all given proto files.
//
@@ -94,9 +96,9 @@ class LIBPROTOC_EXPORT CodeGenerator {
// Returns true if successful. Otherwise, sets *error to a description of
// the problem (e.g. "invalid parameter") and returns false.
virtual bool GenerateAll(const std::vector<const FileDescriptor*>& files,
- const string& parameter,
+ const std::string& parameter,
GeneratorContext* generator_context,
- string* error) const;
+ std::string* error) const;
// This is no longer used, but this class is part of the opensource protobuf
// library, so it has to remain to keep vtables the same for the current
@@ -112,7 +114,7 @@ class LIBPROTOC_EXPORT CodeGenerator {
// abstract interface represents the directory to which the CodeGenerator is
// to write and other information about the context in which the Generator
// runs.
-class LIBPROTOC_EXPORT GeneratorContext {
+class PROTOC_EXPORT GeneratorContext {
public:
inline GeneratorContext() {
}
@@ -128,10 +130,10 @@ class LIBPROTOC_EXPORT GeneratorContext {
// generate the files "foo/bar.pb.h" and "foo/bar.pb.cc"; note that
// "foo/" is included in these filenames. The filename is not allowed to
// contain "." or ".." components.
- virtual io::ZeroCopyOutputStream* Open(const string& filename) = 0;
+ virtual io::ZeroCopyOutputStream* Open(const std::string& filename) = 0;
// Similar to Open() but the output will be appended to the file if exists
- virtual io::ZeroCopyOutputStream* OpenForAppend(const string& filename);
+ virtual io::ZeroCopyOutputStream* OpenForAppend(const std::string& filename);
// Creates a ZeroCopyOutputStream which will insert code into the given file
// at the given insertion point. See plugin.proto (plugin.pb.h) for more
@@ -140,7 +142,7 @@ class LIBPROTOC_EXPORT GeneratorContext {
//
// WARNING: This feature is currently EXPERIMENTAL and is subject to change.
virtual io::ZeroCopyOutputStream* OpenForInsert(
- const string& filename, const string& insertion_point);
+ const std::string& filename, const std::string& insertion_point);
// Returns a vector of FileDescriptors for all the files being compiled
// in this run. Useful for languages, such as Go, that treat files
@@ -166,11 +168,13 @@ typedef GeneratorContext OutputDirectory;
// "foo=bar,baz,qux=corge"
// parses to the pairs:
// ("foo", "bar"), ("baz", ""), ("qux", "corge")
-LIBPROTOC_EXPORT void ParseGeneratorParameter(
- const string&, std::vector<std::pair<string, string> >*);
+PROTOC_EXPORT void ParseGeneratorParameter(
+ const std::string&, std::vector<std::pair<std::string, std::string> >*);
} // namespace compiler
} // namespace protobuf
-
} // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
#endif // GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_H__