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