// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// An object representing a scanned DVD
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Parsing
{
using System.Collections.Generic;
using System.IO;
///
/// An object representing a scanned DVD
///
public class Source
{
///
/// Initializes a new instance of the class.
/// Default constructor for this object
///
public Source()
{
Titles = new List
();
}
///
/// Gets or sets ScanPath.
/// The Path used by the Scan Service.
///
public string ScanPath { get; set; }
///
/// Gets or sets Titles. A list of titles from the source
///
public List Titles { get; set; }
///
/// Parse the StreamReader output into a List of Titles
///
///
/// The output.
///
///
/// A DVD object which contains a list of title inforamtion
///
public static Source Parse(StreamReader output)
{
var thisDVD = new Source();
while (!output.EndOfStream)
{
if ((char) output.Peek() == '+')
thisDVD.Titles.AddRange(Title.ParseList(output.ReadToEnd()));
else
output.ReadLine();
}
return thisDVD;
}
///
/// Copy this Source to another Source Model
///
///
/// The source.
///
public void CopyTo(Source source)
{
source.Titles = this.Titles;
source.ScanPath = this.ScanPath;
}
}
}