public Rule(YR_RULE rule) { IntPtr ptr = rule.identifier; Identifier = Marshal.PtrToStringAnsi(ptr); Tags = ObjRefHelper.IterateCStrings(rule.tags).ToList(); Metas = ObjRefHelper.GetMetas(rule.metas).Select(ExtractMetaValue).ToDictionary(); AtomsCount = rule.num_atoms; }
public Rule(YR_RULE rule) { IntPtr ptr = rule.identifier; Identifier = Marshal.PtrToStringAnsi(ptr); Tags = new List <string>(); ObjRefHelper.ForEachStringInObjRef(rule.tags, Tags.Add); Metas = ObjRefHelper.GetMetas(rule.metas).Select(ExtractMetaValue).ToDictionary(); TimeCost = rule.time_cost; }