Beispiel #1
0
 private void GenerateEnum(Model.Enumeration e, uint indent)
 {
     write_indented(indent, String.Format("enum class {0} : {1}", e.Name, type_to_cpp_type((dynamic)e.Type)));
     write_indented(indent, "{");
     for (int i = 0; i < e.Enumerators.Count; ++i)
     {
         var enumerator = e.Enumerators[i];
         write_indented(indent + 1, String.Format("{0} = {1}{2}", enumerator.Name, enumerator.Value, i != e.Enumerators.Count - 1 ? "," : ""));
     }
     write_indented(indent, "};");
 }
Beispiel #2
0
 private String type_to_cpp_type(Model.Enumeration e)
 {
     return(e.Name);
 }