internal static M3U8TagInstance Create(M3U8Tag tag, string value) { DateTimeOffset result; if (DateTimeOffset.TryParse(value, (IFormatProvider)CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out result)) { return((M3U8TagInstance) new DateTimeTagInstance(tag, result)); } Debug.WriteLine("*** unable to parse date/time: " + value); return((M3U8TagInstance)null); }
internal static M3U8TagInstance Create(M3U8Tag tag, string value) { int length1 = value.IndexOf('@'); if (length1 < 0 || length1 + 1 >= value.Length) { return((M3U8TagInstance) new ByterangeTagInstance(tag, long.Parse(value, (IFormatProvider)CultureInfo.InvariantCulture), new long?())); } long length2 = long.Parse(value.Substring(0, length1), (IFormatProvider)CultureInfo.InvariantCulture); long num = long.Parse(value.Substring(length1 + 1), (IFormatProvider)CultureInfo.InvariantCulture); return((M3U8TagInstance) new ByterangeTagInstance(tag, length2, new long?(num))); }
internal static M3U8TagInstance Create(M3U8Tag tag, string value) { DateTimeOffset dateTimeOffset; if (!DateTimeOffset.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dateTimeOffset)) { Debug.WriteLine("*** unable to parse date/time: " + value); return null; } return new DateTimeTagInstance(tag, dateTimeOffset); }
internal static M3U8TagInstance Create(M3U8Tag tag, string value) { // TODO: Consolidate code between ByterangeAttributeInstance and ByterangeTagInstance var index = value.IndexOf('@'); if (index < 0 || index + 1 >= value.Length) return new ByterangeTagInstance(tag, long.Parse(value, CultureInfo.InvariantCulture), null); var length = long.Parse(value.Substring(0, index), CultureInfo.InvariantCulture); var offset = long.Parse(value.Substring(index + 1), CultureInfo.InvariantCulture); return new ByterangeTagInstance(tag, length, offset); }
internal static ExtinfTagInstance Create(M3U8Tag tag, string value) { if (string.IsNullOrWhiteSpace(value)) { Debug.WriteLine("*** Invalid empty #EXTINF tag"); return(new ExtinfTagInstance(tag, new Decimal(0), (string)null)); } int length = value.IndexOf(','); if (length < 0) { return(new ExtinfTagInstance(tag, ExtinfTagInstance.ParseDuration(value), (string)null)); } Decimal duration = ExtinfTagInstance.ParseDuration(value.Substring(0, length)); string title = string.Empty; if (length + 1 < value.Length) { title = value.Substring(length + 1).Trim(); } return(new ExtinfTagInstance(tag, duration, title)); }
public static ExtKeyTagInstance Create(M3U8Tag tag, string value) { return new ExtKeyTagInstance(tag, ParseAttributes(value, ExtKeySupport.Attributes)); }
internal ExtKeyTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes) : base(tag, attributes) { }
public M3U8TagInstance(M3U8Tag tag) { this.Tag = tag; }
public ByterangeTagInstance(M3U8Tag tag, long length, long? offset) : base(tag) { Length = length; Offset = offset; }
ValueTagInstance(M3U8Tag tag, object value) : base(tag) { Value = value; }
public static ExtStreamInfTagInstance Create(M3U8Tag tag, string value) { return(new ExtStreamInfTagInstance(tag, AttributesTagInstance.ParseAttributes(value, ExtStreamInfSupport.Attributes))); }
internal static ValueTagInstance CreateLong(M3U8Tag tag, string value) { return(ValueTagInstance.Create(tag, value, (Func <string, object>)(v => (object)long.Parse(v, (IFormatProvider)CultureInfo.InvariantCulture)))); }
internal static M3U8TagInstance Create(M3U8Tag tag, string value) { return((M3U8TagInstance) new MapTagInstance(tag)); }
private MapTagInstance(M3U8Tag tag) : base(tag) { }
public ExtinfTagInstance(M3U8Tag tag, Decimal duration, string title = null) : base(tag) { this.Duration = duration; this.Title = title ?? string.Empty; }
private static M3U8TagInstance Create(M3U8Tag tag, string value, Func <string, IEnumerable <M3U8AttributeInstance> > attributeParser) { return((M3U8TagInstance) new AttributesTagInstance(tag, AttributesTagInstance.ParseAttributes(value, attributeParser))); }
public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary <string, M3U8Attribute> attributes) { return(AttributesTagInstance.Create(tag, value, (Func <string, IEnumerable <M3U8AttributeInstance> >)(v => M3U8AttributeParserSupport.ParseAttributes(v, attributes)))); }
internal AttributesTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes) : base(tag) { this.Attributes = attributes; }
private ValueTagInstance(M3U8Tag tag, object value) : base(tag) { this.Value = value; }
public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime) : base(tag) { this.DateTime = dateTime; }
internal static ValueTagInstance Create(M3U8Tag tag, string value, Func <string, object> valueParser) { return(new ValueTagInstance(tag, valueParser(value))); }
internal static ValueTagInstance Create(M3U8Tag tag, string value, Func<string, object> valueParser) { return new ValueTagInstance(tag, valueParser(value)); }
internal ExtStreamInfTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes) : base(tag, attributes) { }
public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime) : base(tag) { DateTime = dateTime; }
public ByterangeTagInstance(M3U8Tag tag, long length, long?offset) : base(tag) { this.Length = length; this.Offset = offset; }
public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value) { return(new M3U8TagInstance(tag)); }
public M3U8TagInstance(M3U8Tag tag) { Tag = tag; }
internal static M3U8TagInstance Create(M3U8Tag tag, string value) { return new MapTagInstance(tag); }
internal AttributesTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes) : base(tag) { Attributes = attributes; }
internal static ValueTagInstance CreateLong(M3U8Tag tag, string value) { return Create(tag, value, v => long.Parse(v, CultureInfo.InvariantCulture)); }
public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary<string, M3U8Attribute> attributes) { return Create(tag, value, v => M3U8AttributeParserSupport.ParseAttributes(v, attributes)); }
static M3U8TagInstance Create(M3U8Tag tag, string value, Func<string, IEnumerable<M3U8AttributeInstance>> attributeParser) { return new AttributesTagInstance(tag, ParseAttributes(value, attributeParser)); }
public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value) { return new M3U8TagInstance(tag); }
MapTagInstance(M3U8Tag tag) : base(tag) { }