protected virtual IEnumerable <IJsonStringFilter> EnumerateFilters(ObjectLoadOptions options) { if (options.HasFlag(ObjectLoadOptions.DecodeHex)) { yield return(new JsonHexDecoder(JsonHexDecoderOptions.FilterNewLineCharacters)); } }
protected override IEnumerable <IJsonStringFilter> EnumerateFilters(ObjectLoadOptions options) { foreach (var f in EnumerateLogUpdateFilters()) { yield return(f); } if (options.HasFlag(ObjectLoadOptions.DecodeHex)) { yield return(new JsonHexDecoder()); } }
public override LogUpdate Load(string json, ObjectLoadOptions options = ObjectLoadOptions.Default) { if (json is null) { return(null); } return(new LogUpdate { Value = FilterJson(json, options) }); }
/// <summary> /// Creates a new object from a <see cref="StringBuilder"/> that contains JSON. /// </summary> public virtual T Load(StringBuilder json, ObjectLoadOptions options = ObjectLoadOptions.Default) { if (json is null) { return(null); } using (var textReader = new StringBuilderReader(FilterJson(json, options))) { return(Load(textReader)); } }
public override LogUpdate Load(StringBuilder json, ObjectLoadOptions options = ObjectLoadOptions.Default) { if (json is null) { return(null); } var copyTo = new StringBuilder(); json.CopyTo(0, copyTo, 0, json.Length); return(new LogUpdate { Value = FilterJson(copyTo, options) }); }
/// <summary> /// Creates a new <see cref="SimulationInfo"/> object from a <see cref="StringBuilder"/> that contains JSON. /// </summary> public static SimulationInfo Load(StringBuilder json, ObjectLoadOptions options) => new Internal.SimulationInfoObjectLoader().Load(json, options);
/// <summary> /// Creates a new <see cref="SlotOptions"/> object from a <see cref="StringBuilder"/> that contains JSON. /// </summary> public static SlotOptions Load(StringBuilder json, ObjectLoadOptions options) => new Internal.SlotOptionsObjectLoader().Load(json, options);
/// <summary> /// Creates a new <see cref="SlotCollection"/> object from a <see cref="String"/> that contains JSON. /// </summary> public static SlotCollection Load(string json, ObjectLoadOptions options) => new Internal.SlotCollectionObjectLoader().Load(json, options);
/// <summary> /// Creates a new <see cref="Info"/> object from a <see cref="String"/> that contains JSON. /// </summary> public static Info Load(string json, ObjectLoadOptions options) => new Internal.InfoObjectLoader().Load(json, options);
/// <summary> /// Creates a new <see cref="LogUpdate"/> object from a <see cref="StringBuilder"/> that contains the log text. /// </summary> public static LogUpdate Load(StringBuilder text, ObjectLoadOptions options) => new Internal.LogUpdateObjectLoader().Load(text, options);
/// <summary> /// Creates a new <see cref="UnitCollection"/> object from a <see cref="StringBuilder"/> that contains JSON. /// </summary> public static UnitCollection Load(StringBuilder json, ObjectLoadOptions options) => new Internal.UnitCollectionObjectLoader().Load(json, options);
protected StringBuilder FilterJson(StringBuilder json, ObjectLoadOptions options) { return(FilterJson(json, EnumerateFilters(options))); }
/// <summary> /// Creates a new <see cref="Options"/> object from a <see cref="String"/> that contains JSON. /// </summary> public static Options Load(string json, ObjectLoadOptions options) => new Internal.OptionsObjectLoader().Load(json, options);