OSDN Git Service

WinGui:
[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 using System.Text.RegularExpressions;\r
6 using System.Windows.Forms;\r
7 \r
8 namespace Handbrake.Parsing\r
9 {\r
10     /// <summary>\r
11     /// An object representing a scanned DVD\r
12     /// </summary>\r
13     public class DVD\r
14     {\r
15         private List<Title> m_titles;\r
16         /// <summary>\r
17         /// Collection of Titles associated with this DVD\r
18         /// </summary>\r
19         public List<Title> Titles\r
20         {\r
21             get\r
22             {\r
23                 return this.m_titles;\r
24             }\r
25         }\r
26 \r
27         /// <summary>\r
28         /// Default constructor for this object\r
29         /// </summary>\r
30         public DVD()\r
31         {\r
32             this.m_titles = new List<Title>();\r
33         }\r
34 \r
35         public static DVD Parse(StreamReader output)\r
36         {\r
37             DVD thisDVD = new DVD();\r
38             while (!output.EndOfStream)\r
39             {\r
40                 if ((char)output.Peek() == '+')\r
41                 {\r
42                     thisDVD.m_titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
43                 }\r
44                 else\r
45                 {\r
46                     output.ReadLine();\r
47                 }\r
48             }\r
49             return thisDVD;\r
50         }\r
51     }\r
52 }\r