【修复】修复bool格式的导出错误
parent
69b54fcd91
commit
4cc52c25a3
|
|
@ -32,9 +32,14 @@ namespace Luban.Job.Cfg.DataExporters
|
||||||
return new YamlScalarNode(x) { Style = ScalarStyle.Plain };
|
return new YamlScalarNode(x) { Style = ScalarStyle.Plain };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static YamlScalarNode ToText(string x)
|
||||||
|
{
|
||||||
|
return new YamlScalarNode(x) { Style = ScalarStyle.SingleQuoted };
|
||||||
|
}
|
||||||
|
|
||||||
public YamlNode Accept(DBool type)
|
public YamlNode Accept(DBool type)
|
||||||
{
|
{
|
||||||
return ToPlainNode(type.Value.ToString());
|
return ToPlainNode(type.Value ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
public YamlNode Accept(DByte type)
|
public YamlNode Accept(DByte type)
|
||||||
|
|
@ -89,7 +94,7 @@ namespace Luban.Job.Cfg.DataExporters
|
||||||
|
|
||||||
public YamlNode Accept(DString type)
|
public YamlNode Accept(DString type)
|
||||||
{
|
{
|
||||||
return new YamlScalarNode(type.Value) { Style = ScalarStyle.SingleQuoted };
|
return ToText(type.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public YamlNode Accept(DBytes type)
|
public YamlNode Accept(DBytes type)
|
||||||
|
|
@ -100,8 +105,8 @@ namespace Luban.Job.Cfg.DataExporters
|
||||||
public YamlNode Accept(DText type)
|
public YamlNode Accept(DText type)
|
||||||
{
|
{
|
||||||
var m = new YamlMappingNode();
|
var m = new YamlMappingNode();
|
||||||
m.Add(DText.KEY_NAME, type.Key);
|
m.Add(DText.KEY_NAME, ToText(type.Key));
|
||||||
m.Add(DText.TEXT_NAME, type.TextOfCurrentAssembly);
|
m.Add(DText.TEXT_NAME, ToText(type.TextOfCurrentAssembly));
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,7 +116,7 @@ namespace Luban.Job.Cfg.DataExporters
|
||||||
|
|
||||||
if (type.Type.IsAbstractType)
|
if (type.Type.IsAbstractType)
|
||||||
{
|
{
|
||||||
m.Add(DefBean.JSON_TYPE_NAME_KEY, DataUtil.GetImplTypeName(type));
|
m.Add(DefBean.JSON_TYPE_NAME_KEY, ToText(DataUtil.GetImplTypeName(type)));
|
||||||
}
|
}
|
||||||
var defFields = type.ImplType.HierarchyFields;
|
var defFields = type.ImplType.HierarchyFields;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Luban.Job.Cfg
|
||||||
[Option('s', "service", Required = true, HelpText = "service")]
|
[Option('s', "service", Required = true, HelpText = "service")]
|
||||||
public string Service { get; set; }
|
public string Service { get; set; }
|
||||||
|
|
||||||
[Option("gen_types", Required = true, HelpText = "code_cs_bin,code_cs_dotnet_json,code_cs_unity_json,code_cs_unity_editor_json,code_lua_bin,code_java_bin,code_java_json,code_go_bin,code_go_json,code_cpp_bin,code_cpp_ue_editor_json,code_python2_json,code_python3_json,code_typescript_bin,code_typescript_json,code_rust_json,code_protobuf,code_template,code_flatbuffers,data_bin,data_lua,data_json,data_json2,data_json_monolithic,data_resources,data_template,data_protobuf_bin,data_protobuf_json,data_flatbuffers_json,convert_json,convert_lua,convert_xlsx . can be multi")]
|
[Option("gen_types", Required = true, HelpText = "code_cs_bin,code_cs_dotnet_json,code_cs_unity_json,code_cs_unity_editor_json,code_lua_bin,code_java_bin,code_java_json,code_go_bin,code_go_json,code_cpp_bin,code_cpp_ue_editor_json,code_python2_json,code_python3_json,code_typescript_bin,code_typescript_json,code_rust_json,code_protobuf,code_template,code_flatbuffers,data_bin,data_lua,data_json,data_json2,data_json_monolithic,data_yaml,data_resources,data_template,data_protobuf_bin,data_protobuf_json,data_flatbuffers_json,convert_json,convert_lua,convert_xlsx . can be multi")]
|
||||||
public string GenType { get; set; }
|
public string GenType { get; set; }
|
||||||
|
|
||||||
[Option("input_data_dir", Required = true, HelpText = "input data dir")]
|
[Option("input_data_dir", Required = true, HelpText = "input data dir")]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue