Esempio n. 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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
 protected ppFormatCrypto(string name, ppHeader header, ppFormatIdx idx)
     : base(name, header, idx)
 {
 }
Esempio n. 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;
        }
Esempio n. 5
0
 protected ppFormat(string name, ppHeader header, ppFormatIdx idx)
 {
     this.Name = name;
     this.ppHeader = header;
     this.ppFormatIdx = idx;
 }
Esempio n. 6
0
 public ppEditor(ppHeader parser)
 {
     throw new Exception("Either use OpenPP(path, format) or use ppEditor(path, header).");
 }
Esempio n. 7
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");
 }
Esempio n. 8
0
 protected ppFormatCrypto(string name, ppHeader header, ppFormatIdx idx) : base(name, header, idx)
 {
 }
Esempio n. 9
0
 protected ppFormat(string name, ppHeader header, ppFormatIdx idx)
 {
     this.Name        = name;
     this.ppHeader    = header;
     this.ppFormatIdx = idx;
 }
Esempio n. 10
0
 public ppEditor(ppHeader parser)
 {
     throw new Exception("Either use OpenPP(path, format) or use ppEditor(path, header).");
 }
Esempio n. 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");
 }