aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/java/java_context.h
diff options
context:
space:
mode:
authorAdam Cozzette <acozzette@google.com>2016-06-29 15:23:27 -0700
committerAdam Cozzette <acozzette@google.com>2016-06-29 15:38:03 -0700
commitd64a2d9941c36a7bc2a7959ea10ab8363192ac14 (patch)
tree52330d146ad63d3d70f3baade00d5d1fea8f5e0c /src/google/protobuf/compiler/java/java_context.h
parentc18aa7795a2e02ef700ff8b039d94ecdcc33432f (diff)
downloadprotobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.tar.gz
protobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.tar.bz2
protobuf-d64a2d9941c36a7bc2a7959ea10ab8363192ac14.zip
Integrated internal changes from Google
This includes all internal changes from around May 20 to now.
Diffstat (limited to 'src/google/protobuf/compiler/java/java_context.h')
-rw-r--r--src/google/protobuf/compiler/java/java_context.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/java/java_context.h b/src/google/protobuf/compiler/java/java_context.h
index a480e45d..f92ae87e 100644
--- a/src/google/protobuf/compiler/java/java_context.h
+++ b/src/google/protobuf/compiler/java/java_context.h
@@ -39,6 +39,7 @@
#include <vector>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/compiler/java/java_options.h>
namespace google {
namespace protobuf {
@@ -64,7 +65,7 @@ struct OneofGeneratorInfo;
// generators.
class Context {
public:
- explicit Context(const FileDescriptor* file);
+ Context(const FileDescriptor* file, const Options& options);
~Context();
// Get the name resolver associated with this context. The resolver
@@ -79,15 +80,12 @@ class Context {
const OneofGeneratorInfo* GetOneofGeneratorInfo(
const OneofDescriptor* oneof) const;
+ const Options& options() const { return options_; }
+
// Enforces all the files (including transitive dependencies) to use
// LiteRuntime.
- void SetEnforceLite(bool enforce_lite) {
- enforce_lite_ = enforce_lite;
- }
- bool EnforceLite() const {
- return enforce_lite_;
- }
+ bool EnforceLite() const { return options_.enforce_lite; }
// Does this message class have generated parsing, serialization, and other
// standard methods for which reflection-based fallback implementations exist?
@@ -102,7 +100,7 @@ class Context {
google::protobuf::scoped_ptr<ClassNameResolver> name_resolver_;
map<const FieldDescriptor*, FieldGeneratorInfo> field_generator_info_map_;
map<const OneofDescriptor*, OneofGeneratorInfo> oneof_generator_info_map_;
- bool enforce_lite_;
+ Options options_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context);
};