OSDN Git Service

add win/C# diff files
[handbrake-jp/handbrake-jp.git] / win / C# / HandBrake.ApplicationServices / Parsing / DVD.cs.diff
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs.diff b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs.diff
new file mode 100644 (file)
index 0000000..2f4eb85
--- /dev/null
@@ -0,0 +1,60 @@
+diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
+new file mode 100644
+index 0000000..c7e5a27
+--- /dev/null
++++ b/win/C#/HandBrake.ApplicationServices/Parsing/DVD.cs
+@@ -0,0 +1,53 @@
++/*  DVD.cs $    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
++namespace HandBrake.ApplicationServices.Parsing\r
++{\r
++    using System.Collections.Generic;\r
++    using System.IO;\r
++\r
++    /// <summary>\r
++    /// An object representing a scanned DVD\r
++    /// </summary>\r
++    public class DVD\r
++    {\r
++        /// <summary>\r
++        /// Initializes a new instance of the <see cref="DVD"/> class. \r
++        /// Default constructor for this object\r
++        /// </summary>\r
++        public DVD()\r
++        {\r
++            Titles = new List<Title>();\r
++        }\r
++\r
++        /// <summary>\r
++        /// Gets Titles. A list of titles from the source\r
++        /// </summary>\r
++        public List<Title> Titles { get; private set; }\r
++\r
++        /// <summary>\r
++        /// Parse the StreamReader output into a List of Titles\r
++        /// </summary>\r
++        /// <param name="output">\r
++        /// The output.\r
++        /// </param>\r
++        /// <returns>\r
++        /// A DVD object which contains a list of title inforamtion\r
++        /// </returns>\r
++        public static DVD Parse(StreamReader output)\r
++        {\r
++            var thisDVD = new DVD();\r
++\r
++            while (!output.EndOfStream)\r
++            {\r
++                if ((char) output.Peek() == '+')\r
++                    thisDVD.Titles.AddRange(Title.ParseList(output.ReadToEnd()));\r
++                else\r
++                    output.ReadLine();\r
++            }\r
++\r
++            return thisDVD;\r
++        }\r
++    }\r
++}
+\ No newline at end of file