Allow other pointer types than unique_ptr for object API.

Change-Id: I945890ce667a2f5a6c0495e78fd5326ed33b9914
Tested: on Linux.
Bug: 30135763
This commit is contained in:
Wouter van Oortmerssen
2016-10-12 16:46:03 -07:00
parent 424fc0c3ac
commit d9fe4e2769
8 changed files with 184 additions and 82 deletions

View File

@@ -347,6 +347,7 @@ struct IDLOptions {
bool generate_name_strings;
bool escape_proto_identifiers;
bool generate_object_based_api;
std::string cpp_object_api_pointer_type;
bool union_value_namespacing;
bool allow_non_utf8;
@@ -370,6 +371,7 @@ struct IDLOptions {
generate_name_strings(false),
escape_proto_identifiers(false),
generate_object_based_api(false),
cpp_object_api_pointer_type("std::unique_ptr"),
union_value_namespacing(true),
allow_non_utf8(false),
lang(IDLOptions::kJava) {}
@@ -451,6 +453,7 @@ class Parser : public ParserState {
known_attributes_["streaming"] = true;
known_attributes_["idempotent"] = true;
known_attributes_["cpp_type"] = true;
known_attributes_["cpp_ptr_type"] = true;
}
~Parser() {