diff --git a/schema/code/generate-cpp-for-ac-model-schema.rb b/schema/code/generate-cpp-for-ac-model-schema.rb index 5bf4748e..43ba5a46 100644 --- a/schema/code/generate-cpp-for-ac-model-schema.rb +++ b/schema/code/generate-cpp-for-ac-model-schema.rb @@ -24,6 +24,8 @@ def camel_case def generate_read_from_val(pr) if pr[:type] == :object "#{pr[:cpp_val_type]}::fromDict(val)" + elsif pr[:type] == :binary + "std::move(val.get_binary())" else "std::move(val.get<#{pr[:cpp_val_type]}>())" end @@ -36,6 +38,12 @@ def generate_write(pr) else "#{pr[:cpp_name]}.toDict()" end + elsif pr[:type] == :binary + if (pr[:opt]) + "Dict::binary(std::move(*#{pr[:cpp_name]}))" + else + "Dict::binary(std::move(#{pr[:cpp_name]}))" + end else if (pr[:opt]) "std::move(*#{pr[:cpp_name]})"