Просмотр исходного кода

[cpp] Use String, rather than Objects, for optional String types

Hugh 8 лет назад
Родитель
Сommit
01efb80e95
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/generators/gencpp.ml

+ 4 - 1
src/generators/gencpp.ml

@@ -5076,8 +5076,11 @@ let access_str a = match a with
    | AccRequire(_,_) -> "AccRequire" ;;
 
 
-let script_type t optional = if optional then "Object" else
+let script_type t optional = if optional then begin
    match type_string t with
+   | "::String" -> "String"
+   | _ -> "Object"
+   end else match type_string t with
    | "bool" -> "Int"
    | "int" -> "Int"
    | "Float" -> "Float"