public override List <Record> ReadMulti(TBean type) { var datas = new List <Record>(); foreach (var sheet in _sheets) { try { foreach (var r in sheet.GetRows()) { TitleRow row = r.Row; string tagStr = r.Tag; if (DataUtil.IsIgnoreTag(tagStr)) { continue; } var data = (DBean)type.Apply(SheetDataCreator.Ins, sheet, row); datas.Add(new Record(data, sheet.RawUrl, DataUtil.ParseTags(tagStr))); } } catch (DataCreateException dce) { dce.OriginDataLocation = sheet.RawUrl; throw; } catch (Exception e) { throw new Exception($"sheet:{sheet.Name}", e); } } return(datas); }
public override List <DType> ReadMulti(TBean type) { var records = new List <DType>(); foreach (LuaTable t in _dataTable.Values.Values) { records.Add(type.Apply(LuaDataCreator.Ins, t, (DefAssembly)type.Bean.AssemblyBase)); } return(records); }
public string Accept(TBean type, string fieldName, string logType) { if (type.Bean.IsAbstractType) { return($"{fieldName} = default;"); } else { return($"{fieldName} = new {type.Apply(DbCsDefineTypeVisitor.Ins)}();"); } }
public override Record ReadOne(TBean type) { string tagName = _doc.Element(TAG_KEY)?.Value; if (DataUtil.IsIgnoreTag(tagName)) { return(null); } var data = (DBean)type.Apply(XmlDataCreator.Ins, _doc, (DefAssembly)type.Bean.AssemblyBase); var tags = DataUtil.ParseTags(tagName); return(new Record(data, RawUrl, tags)); }
public string Accept(TBean type, string bufName, string fieldName) { var bean = type.Bean; if (bean.IsNotAbstractType) { return($"{fieldName} = new {type.Apply(DbCsDefineTypeVisitor.Ins)}(); {fieldName}.Deserialize({bufName});"); } else { return($"{fieldName} = {bean.FullName}.Deserialize{bean.Name}({bufName});"); } }
protected Record ReadRecord(LuaTable table, TBean type) { string tagName = table.GetValue(TAG_KEY)?.ToString(); if (DataUtil.IsIgnoreTag(tagName)) { return(null); } var data = (DBean)type.Apply(LuaDataCreator.Ins, table, (DefAssembly)type.Bean.AssemblyBase); var tags = DataUtil.ParseTags(tagName); return(new Record(data, RawUrl, tags)); }
private Record ReadRecord(JsonElement ele, TBean type) { List <string> tags; if (ele.TryGetProperty(TAG_KEY, out var tagEle)) { var tagName = tagEle.GetString(); if (DataUtil.IsIgnoreTag(tagName)) { return(null); } tags = DataUtil.ParseTags(tagName); } else { tags = null; } var data = (DBean)type.Apply(JsonDataCreator.Ins, ele, (DefAssembly)type.Bean.AssemblyBase); return(new Record(data, RawUrl, tags)); }
public override string Accept(TBean type) { return(type.Apply(CppUnderingDefineTypeName.Ins)); }
public override DType ReadOne(TBean type) { return(type.Apply(XmlDataCreator.Ins, _doc, (DefAssembly)type.Bean.AssemblyBase)); }
public override string Accept(TBean type) { return(type.Bean.IsAbstractType ? "default" : $"new {type.Apply(CsDefineTypeName.Ins)}()"); }
public override string Accept(TBean type, string bufName, string fieldName) { return(type.Apply(CsUnderingDeserializeVisitor.Ins, bufName, fieldName)); }
public override string Accept(TBean type, string bufName, string fieldName) { return(type.Apply(UnderringVisitor, bufName, fieldName)); }
public override string Accept(TBean type) { return(type.IsNullable || type.Bean.IsAbstractType ? "default" : $"new {type.Apply(CsEditorUnderlyingDefineTypeName.Ins)}()"); }