OSDN Git Service

added new parsing code to parse cli output into objects
[handbrake-jp/handbrake-jp-git.git] / win / C# / Parsing / DVD.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.IO;\r
5 \r
6 namespace Handbrake.Parsing\r
7 {\r
8     public class DVD\r
9     {\r
10         private List<Title> m_titles;\r
11         public List<Title> Titles\r
12         {\r
13             get\r
14             {\r
15                 return this.m_titles;\r
16             }\r
17         }\r
18 \r
19         public DVD()\r
20         {\r
21             this.m_titles = new List<Title>();\r
22         }\r
23 \r
24         public static DVD Parse(StreamReader output)\r
25         {\r
26             DVD thisDVD = new DVD();\r
27             while (!output.EndOfStream)\r
28             {\r
29                 string curLine = output.ReadLine();\r
30                 if (curLine.Contains("Scanning title"))\r
31                 {\r
32                     thisDVD.m_titles.AddRange(Title.ParseList(output));\r
33                 }\r
34             }\r
35             return thisDVD;\r
36         }\r
37     }\r
38 }\r