/*
  * Enumerator for pack at given file path.
  */
 public PackFileEnumerator(string path)
 {
     filepath      = path;
     reader        = new BinaryReader(File.OpenRead(path));
     header        = PackFileCodec.ReadHeader(reader);
     startPosition = reader.BaseStream.Position;
     Reset();
 }
Ejemplo n.º 2
0
 public PackLoadOrder(ICollection <string> files)
 {
     foreach (string file in files)
     {
         try {
             PFHeader header = PackFileCodec.ReadHeader(file);
             nameToHeader.Add(file, header);
             nameToPath.Add(Path.GetFileName(file), file);
         } catch { } // couldn't read header probably; just ignore the file
     }
 }
Ejemplo n.º 3
0
        /*
         * Query if a pack file is provided by CA.
         */
        public static bool IsDbCaPack(string filename)
        {
            foreach (string exclude in EXCLUDE_PREFIXES)
            {
                if (Path.GetFileName(filename).StartsWith(exclude))
                {
                    return(true);
                }
            }
            bool result = false;

            try {
                PFHeader pack = PackFileCodec.ReadHeader(filename);
                result = (pack.Type != PackType.Patch) && (pack.Type != PackType.Release);
            } catch {} // not a valid pack: not a CA pack
            return(result);
        }