Ejemplo n.º 1
0
 private bool CheckCUE()
 {
     State  = FileState.ValidFile;
     Encode = EncodingDetector.GetEncoding(FullPath, out _confidence);
     if (Encode != "UTF-8")
     {
         State = FileState.InValidEncode;
         return(false);
     }
     using (var fs = File.OpenRead(FullPath))
     {
         var buffer = new byte[3];
         fs.Read(buffer, 0, 3);
         if (buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF)
         {
             if (!CueCurer.CueMatchCheck(this))
             {
                 State = FileState.InValidCue;
             }
             return(true);
         }
     }
     State = FileState.NonUTF8WBOM;
     return(false);
 }
Ejemplo n.º 2
0
        public void CueMatchCheckTest()
        {
            var cueFiles = new List <FileDescription>();

            foreach (var folder in ConvertMethod.GetFileList(@"..\..\[Match Sample]").Values)
            {
                cueFiles.AddRange(folder.Where(file => file.Extension.ToLower() == ".cue"));
            }

            foreach (var cue in cueFiles)
            {
                Console.WriteLine(cue);
                Assert.IsTrue(CueCurer.CueMatchCheck(cue));
            }
        }