Nullable java (#4455)

* add _Nullable Support for C++ interface

* generate @Nullable for Java generated code
This commit is contained in:
Yonggang Li
2017-10-16 09:24:11 -07:00
committed by Wouter van Oortmerssen
parent a1b5f565d9
commit 01bac38c84
5 changed files with 28 additions and 11 deletions

View File

@@ -89,7 +89,7 @@ std::string FlatCompiler::GetUsageString(const char* program_name) const {
" --cpp-ptr-type T Set object API pointer type (default std::unique_ptr)\n"
" --cpp-str-type T Set object API string type (default std::string)\n"
" T::c_str() and T::length() must be supported\n"
" --clang-nullable Add Clang _Nullable for C++ pointers.\n"
" --gen-nullable Add Clang _Nullable for C++ pointer. or @Nullable for Java\n"
" --object-prefix Customise class prefix for C++ object-based API.\n"
" --object-suffix Customise class suffix for C++ object-based API.\n"
" Default value is \"T\"\n"
@@ -211,8 +211,8 @@ int FlatCompiler::Compile(int argc, const char** argv) {
} else if (arg == "--cpp-str-type") {
if (++argi >= argc) Error("missing type following" + arg, true);
opts.cpp_object_api_string_type = argv[argi];
} else if (arg == "--clang-nullable") {
opts.clang_nullable = true;
} else if (arg == "--gen-nullable") {
opts.gen_nullable = true;
} else if (arg == "--object-prefix") {
if (++argi >= argc) Error("missing prefix following" + arg, true);
opts.object_prefix = argv[argi];