-using System;\r
+/* DVD.cs $\r
+ \r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
using System.Collections.Generic;\r
-using System.Text;\r
using System.IO;\r
\r
namespace Handbrake.Parsing\r
{\r
+ /// <summary>\r
+ /// An object representing a scanned DVD\r
+ /// </summary>\r
public class DVD\r
{\r
- private List<Title> m_titles;\r
- public List<Title> Titles\r
+ private readonly List<Title> m_titles;\r
+\r
+ /// <summary>\r
+ /// Default constructor for this object\r
+ /// </summary>\r
+ public DVD()\r
{\r
- get\r
- {\r
- return this.m_titles;\r
- }\r
+ m_titles = new List<Title>();\r
}\r
\r
- public DVD()\r
+ /// <summary>\r
+ /// Collection of Titles associated with this DVD\r
+ /// </summary>\r
+ public List<Title> Titles\r
{\r
- this.m_titles = new List<Title>();\r
+ get { return m_titles; }\r
}\r
\r
public static DVD Parse(StreamReader output)\r
{\r
- DVD thisDVD = new DVD();\r
+ var thisDVD = new DVD();\r
+\r
while (!output.EndOfStream)\r
{\r
- string curLine = output.ReadLine();\r
-\r
- if (curLine.Contains("Scanning title"))\r
- {\r
- thisDVD.m_titles.AddRange(Title.ParseList(output));\r
- }\r
+ if ((char) output.Peek() == '+')\r
+ thisDVD.m_titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
+ else\r
+ output.ReadLine();\r
}\r
+\r
return thisDVD;\r
}\r
}\r
-}\r
+}
\ No newline at end of file