예제 #1
0
        public static ppFormat GetFormat(string path)
        {
            ppHeader header = null;

            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(path)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;

            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List <IWriteFile> subfiles = header.ReadHeader(path, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile((ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }

                if (resultFormat == null)
                {
                    resultFormat = header.ppFormats[0];
                    Report.ReportLog("Couldn't auto-detect the ppFormat for " + path + ". Using " + resultFormat.Name + " instead");
                }
            }

            return(resultFormat);
        }
예제 #2
0
파일: ppFormat.cs 프로젝트: ezdiy/GDImport
        public static ppFormat GetFormat(FileStream stream, out ppHeader header)
        {
            header = null;
            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(stream)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;

            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List <IWriteFile> subfiles = header.ReadHeader(stream, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile(stream, (ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }
            }

            return(resultFormat);
        }
예제 #3
0
 protected ppFormatCrypto(string name, ppHeader header, ppFormatIdx idx)
     : base(name, header, idx)
 {
 }
예제 #4
0
        public static ppFormat GetFormat(FileStream stream, out ppHeader header)
        {
            header = null;
            for (int i = 0; i < ppHeader.Array.Length; i++)
            {
                try
                {
                    if ((header = ppHeader.Array[i].TryHeader(stream)) != null)
                    {
                        break;
                    }
                }
                catch
                {
                }
            }

            ppFormat resultFormat = null;
            if (header != null)
            {
                if (header.ppFormats.Length == 1)
                {
                    resultFormat = header.ppFormats[0];
                }
                else
                {
                    List<IWriteFile> subfiles = header.ReadHeader(stream, null);
                    for (int i = 0; i < subfiles.Count; i++)
                    {
                        if ((resultFormat = TryFile(stream, (ppSubfile)subfiles[i], header.ppFormats)) != null)
                        {
                            break;
                        }
                    }
                }
            }

            return resultFormat;
        }
예제 #5
0
 protected ppFormat(string name, ppHeader header, ppFormatIdx idx)
 {
     this.Name = name;
     this.ppHeader = header;
     this.ppFormatIdx = idx;
 }
예제 #6
0
파일: ppEditor.cs 프로젝트: kkdevs/sb3u
 public ppEditor(ppHeader parser)
 {
     throw new Exception("Either use OpenPP(path, format) or use ppEditor(path, header).");
 }
예제 #7
0
파일: ppEditor.cs 프로젝트: kkdevs/sb3u
 public ppEditor(string path, ppHeader header) : this(new ppParser(path, header.ppFormats[0]))
 {
     Report.ReportLog("Couldn't auto-detect the ppFormat for " + path + ". Using " + Parser.Format + " instead");
 }
예제 #8
0
 protected ppFormatCrypto(string name, ppHeader header, ppFormatIdx idx) : base(name, header, idx)
 {
 }
예제 #9
0
 protected ppFormat(string name, ppHeader header, ppFormatIdx idx)
 {
     this.Name        = name;
     this.ppHeader    = header;
     this.ppFormatIdx = idx;
 }
예제 #10
0
 public ppEditor(ppHeader parser)
 {
     throw new Exception("Either use OpenPP(path, format) or use ppEditor(path, header).");
 }
예제 #11
0
 public ppEditor(string path, ppHeader header)
     : this(new ppParser(path, header.ppFormats[0]))
 {
     Report.ReportLog("Couldn't auto-detect the ppFormat for " + path + ". Using " + Parser.Format + " instead");
 }