Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 public static HKXParser ParseHKX(string s)
 {
     FileDataStream fds = new FileDataStream(s);
       HKXParser p = new HKXParser(fds);
       p.Parse();
       fds.Close();
       return p;
 }
Exemplo n.º 3
0
 public void Close()
 {
     if (fileStream != null)
     {
         fileStream.Close();
         fileStream = null;
     }
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 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();
 }