/// <summary> /// A class that allows the easy manipulation of RAF archives /// </summary> /// <param name="rafPath">Path to the .raf file</param> public RAFArchive(string rafPath) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); m_rafPath = rafPath; FileInfo fi = new FileInfo(rafPath); m_id = RAFArchiveID.CreateID(fi.Directory.Name); m_content = File.ReadAllBytes(rafPath); m_magic = BitConverter.ToUInt32(m_content.SubArray(0, 4), 0); m_version = BitConverter.ToUInt32(m_content.SubArray(4, 4), 0); m_mgrIndex = BitConverter.ToUInt32(m_content.SubArray(8, 4), 0); // Offset to the table of contents from the start of the file UInt32 offsetFileList = BitConverter.ToUInt32(m_content.SubArray(12, 4), 0); // Offset to the string table from the start of the file UInt32 offsetStringTable = BitConverter.ToUInt32(m_content.SubArray(16, 4), 0); //UINT32 is casted to INT32. This should be fine, since i doubt that the RAF will become //a size of 2^31-1 in bytes. m_fileDictFull = new Dictionary <String, RAFFileListEntry>(); m_fileDictShort = new Dictionary <String, List <RAFFileListEntry> >(); CreateFileDicts(this, offsetFileList, offsetStringTable); }
protected bool Equals(RAFArchiveID other) { return this == other; }
protected bool Equals(RAFArchiveID other) { return(this == other); }
/// <summary> /// A class that allows the easy manipulation of RAF archives /// </summary> /// <param name="rafPath">Path to the .raf file</param> public RAFArchive(string rafPath) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); m_rafPath = rafPath; FileInfo fi = new FileInfo(rafPath); m_id = RAFArchiveID.CreateID(fi.Directory.Name); m_content = File.ReadAllBytes(rafPath); m_magic = BitConverter.ToUInt32(m_content.SubArray(0, 4), 0); m_version = BitConverter.ToUInt32(m_content.SubArray(4, 4), 0); m_mgrIndex = BitConverter.ToUInt32(m_content.SubArray(8, 4), 0); // Offset to the table of contents from the start of the file UInt32 offsetFileList = BitConverter.ToUInt32(m_content.SubArray(12, 4), 0); // Offset to the string table from the start of the file UInt32 offsetStringTable = BitConverter.ToUInt32(m_content.SubArray(16, 4), 0); //UINT32 is casted to INT32. This should be fine, since i doubt that the RAF will become //a size of 2^31-1 in bytes. m_fileDictFull = new Dictionary<String, RAFFileListEntry>(); m_fileDictShort = new Dictionary<String, List<RAFFileListEntry>>(); CreateFileDicts(this, offsetFileList, offsetStringTable); }