aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/python/python_generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/python/python_generator.h')
-rw-r--r--src/google/protobuf/compiler/python/python_generator.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/google/protobuf/compiler/python/python_generator.h b/src/google/protobuf/compiler/python/python_generator.h
index 8e4050de..c21c36da 100644
--- a/src/google/protobuf/compiler/python/python_generator.h
+++ b/src/google/protobuf/compiler/python/python_generator.h
@@ -38,8 +38,8 @@
#include <string>
#include <google/protobuf/compiler/code_generator.h>
-#include <google/protobuf/stubs/mutex.h>
-#include <google/protobuf/stubs/common.h>
+
+#include <google/protobuf/port_def.inc>
namespace google {
namespace protobuf {
@@ -60,16 +60,16 @@ namespace python {
// If you create your own protocol compiler binary and you want it to support
// Python output, you can do so by registering an instance of this
// CodeGenerator with the CommandLineInterface in your main() function.
-class LIBPROTOC_EXPORT Generator : public CodeGenerator {
+class PROTOC_EXPORT Generator : public CodeGenerator {
public:
Generator();
virtual ~Generator();
// CodeGenerator methods.
virtual bool Generate(const FileDescriptor* file,
- const string& parameter,
+ const std::string& parameter,
GeneratorContext* generator_context,
- string* error) const;
+ std::string* error) const;
private:
void PrintImports() const;
@@ -86,7 +86,7 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
void PrintFieldDescriptorsInDescriptor(
const Descriptor& message_descriptor,
bool is_extension,
- const string& list_variable_name,
+ const std::string& list_variable_name,
int (Descriptor::*CountFn)() const,
const FieldDescriptor* (Descriptor::*GetterFn)(int) const) const;
void PrintFieldsInDescriptor(const Descriptor& message_descriptor) const;
@@ -96,11 +96,11 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
void PrintNestedDescriptors(const Descriptor& containing_descriptor) const;
void PrintMessages() const;
- void PrintMessage(const Descriptor& message_descriptor, const string& prefix,
- std::vector<string>* to_register) const;
+ void PrintMessage(const Descriptor& message_descriptor, const std::string& prefix,
+ std::vector<std::string>* to_register) const;
void PrintNestedMessages(const Descriptor& containing_descriptor,
- const string& prefix,
- std::vector<string>* to_register) const;
+ const std::string& prefix,
+ std::vector<std::string>* to_register) const;
void FixForeignFieldsInDescriptors() const;
void FixForeignFieldsInDescriptor(
@@ -108,14 +108,14 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
const Descriptor* containing_descriptor) const;
void FixForeignFieldsInField(const Descriptor* containing_type,
const FieldDescriptor& field,
- const string& python_dict_name) const;
+ const std::string& python_dict_name) const;
void AddMessageToFileDescriptor(const Descriptor& descriptor) const;
void AddEnumToFileDescriptor(const EnumDescriptor& descriptor) const;
void AddExtensionToFileDescriptor(const FieldDescriptor& descriptor) const;
void AddServiceToFileDescriptor(const ServiceDescriptor& descriptor) const;
- string FieldReferencingExpression(const Descriptor* containing_type,
+ std::string FieldReferencingExpression(const Descriptor* containing_type,
const FieldDescriptor& field,
- const string& python_dict_name) const;
+ const std::string& python_dict_name) const;
template <typename DescriptorT>
void FixContainingTypeInDescriptor(
const DescriptorT& descriptor,
@@ -135,13 +135,13 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
const ServiceDescriptor& descriptor) const;
void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const;
- string OptionsValue(const string& serialized_options) const;
+ std::string OptionsValue(const std::string& serialized_options) const;
bool GeneratingDescriptorProto() const;
template <typename DescriptorT>
- string ModuleLevelDescriptorName(const DescriptorT& descriptor) const;
- string ModuleLevelMessageName(const Descriptor& descriptor) const;
- string ModuleLevelServiceDescriptorName(
+ std::string ModuleLevelDescriptorName(const DescriptorT& descriptor) const;
+ std::string ModuleLevelMessageName(const Descriptor& descriptor) const;
+ std::string ModuleLevelServiceDescriptorName(
const ServiceDescriptor& descriptor) const;
template <typename DescriptorT, typename DescriptorProtoT>
@@ -155,13 +155,13 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
void FixOptionsForMessage(const Descriptor& descriptor) const;
void CopyPublicDependenciesAliases(
- const string& copy_from, const FileDescriptor* file) const;
+ const std::string& copy_from, const FileDescriptor* file) const;
// Very coarse-grained lock to ensure that Generate() is reentrant.
// Guards file_, printer_ and file_descriptor_serialized_.
mutable Mutex mutex_;
mutable const FileDescriptor* file_; // Set in Generate(). Under mutex_.
- mutable string file_descriptor_serialized_;
+ mutable std::string file_descriptor_serialized_;
mutable io::Printer* printer_; // Set in Generate(). Under mutex_.
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Generator);
@@ -170,6 +170,8 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
} // namespace python
} // namespace compiler
} // namespace protobuf
-
} // namespace google
+
+#include <google/protobuf/port_undef.inc>
+
#endif // GOOGLE_PROTOBUF_COMPILER_PYTHON_GENERATOR_H__