Skip to content

Instantly share code, notes, and snippets.

@LordNed
Created July 15, 2015 04:49
Show Gist options
  • Save LordNed/963dfaf512721f1c37e6 to your computer and use it in GitHub Desktop.
Save LordNed/963dfaf512721f1c37e6 to your computer and use it in GitHub Desktop.
/// <summary>
/// Represents a file or subdirectory within a RARC archive.
/// </summary>
private class FileEntry
{
/// <summary>File ID. If 0xFFFF, then this entry is a subdirectory link.</summary>
public ushort ID { get; internal set; }
/// <summary>String hash of the <see cref="Name"/> field.</summary>
public ushort NameHashcode { get; internal set; }
/// <summary>Unknown value</summary>
public byte Type { get; internal set; }
/// <summary> Padding byte. Included here for the sake of documentation. </summary>
public byte Padding { get; internal set; }
/// <summary>File/subdirectory name string table offset.</summary>
public string Name { get; internal set; }
/// <summary>Data bytes. If this entry is a directory, it will be the node index.</summary>
public byte[] Data { get; internal set; }
/// <summary>Always zero.</summary>
public uint ZeroPadding { get; internal set; }
// Non actual struct items
/// <summary>Whether or not this entry is a directory.</summary>
public bool IsDirectory { get { return ID == 0xFFF; } }
/// <summary>Node index representing the subdirectory. Will only be non-zero if IsDirectory is true.</summary>
public uint SubDirIndex { get; internal set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment