public void SaveFileFormat() { if (FileFormat != null && FileFormat.CanSave) { if (FileDataStream != null) { Console.WriteLine($"Updating FileDataStream " + (FileDataStream is FileStream)); if (FileDataStream is FileStream) { FileDataStream.Close(); } var mem = new System.IO.MemoryStream(); FileFormat.Save(mem); FileDataStream = mem; //Reload file data FileFormat.Load(FileDataStream); } else { var mem = new System.IO.MemoryStream(); FileFormat.Save(mem); FileData = STLibraryCompression.CompressFile(mem.ToArray(), FileFormat); } } }
public static HKXParser ParseHKX(string s) { FileDataStream fds = new FileDataStream(s); HKXParser p = new HKXParser(fds); p.Parse(); fds.Close(); return p; }
public void Close() { if (fileStream != null) { fileStream.Close(); fileStream = null; } }
public static TPFParser ParseTPF(string s) { FileDataStream fds = new FileDataStream(s); TPFParser p = new TPFParser(Path.GetFileNameWithoutExtension(s), fds); p.Parse(); fds.Close(); return p; }
public BHFParser ParseBHF(string s) { FileDataStream fds = new FileDataStream(s); BHFParser p = new BHFParser(Path.GetFileNameWithoutExtension(s), fds); p.DB = bdfdb; p.w = w; p.Parse(); fds.Close(); return p; }
public void ParseBDF(string s, bool extract = true) { FileDataStream fds = new FileDataStream(s); BDFParser p = new BDFParser(Path.GetFileNameWithoutExtension(s), fds); p.DB = bdfdb; p.w = w; p.Extract = extract; p.Parse(); fds.Close(); }