C# Class TagTool.Cache.TagCache

Provides methods for easily editing tags.dat files.
Afficher le fichier Open project: TheGuardians/TagTool Class Usage Examples

Méthodes publiques

Méthode Description
AllocateTag ( ) : TagInstance

Allocates a new tag at the end of the tag list without updating the file. The tag's group will be null until it is assigned data. You can give the tag data by using one of the overwrite functions.

AllocateTag ( TagGroup type ) : TagInstance

Allocates a new tag at the end of the tag list without updating the file. You can give the tag data by using one of the overwrite functions.

DuplicateTag ( Stream stream, TagInstance tag ) : TagInstance

Duplicates a tag.

ExtractTag ( Stream stream, TagInstance tag ) : TagData

Reads a tag's data from the file.

ExtractTagRaw ( Stream stream, TagInstance tag ) : byte[]

Reads a tag's raw data from the file, including its header.

SetTagData ( Stream stream, TagInstance tag, TagData data ) : void

Overwrites a tag's data.

SetTagDataRaw ( Stream stream, TagInstance tag, byte data ) : void

Overwrites a tag's raw data, including its header.

TagCache ( Stream stream ) : System

Opens a tags.dat file from a stream.

UpdateTagOffsets ( BinaryWriter writer ) : void

Updates the tag offset table in the file.

Private Methods

Méthode Description
BuildTagDescription ( Stream stream, TagInstance tag, uint &dataOffset ) : TagData

Builds a description for a tag's data without extracting anything.

FixTagOffsets ( long startOffset, long sizeDelta, TagInstance ignore ) : void

Fixes tag offsets after a resize operation.

GetNewTagOffset ( int index ) : long

Gets the offset that a new tag should be inserted at so that the tags are stored in order by index.

GetTagDataEndOffset ( ) : long

Gets the tag data end offset.

Load ( BinaryReader reader ) : void

Reads the tags.dat file.

ResizeBlock ( Stream stream, TagInstance tag, long startOffset, long oldSize, long newSize ) : void

Resizes a block of data in the file.

UpdateFileHeader ( BinaryWriter writer, long offsetTableOffset ) : void

Updates the file header.

Method Details

AllocateTag() public méthode

Allocates a new tag at the end of the tag list without updating the file. The tag's group will be null until it is assigned data. You can give the tag data by using one of the overwrite functions.
public AllocateTag ( ) : TagInstance
Résultat TagTool.TagGroups.TagInstance

AllocateTag() public méthode

Allocates a new tag at the end of the tag list without updating the file. You can give the tag data by using one of the overwrite functions.
public AllocateTag ( TagGroup type ) : TagInstance
type TagGroup The tag's type information.
Résultat TagTool.TagGroups.TagInstance

DuplicateTag() public méthode

Duplicates a tag.
public DuplicateTag ( Stream stream, TagInstance tag ) : TagInstance
stream Stream The stream to write to.
tag TagTool.TagGroups.TagInstance The tag to duplicate.
Résultat TagTool.TagGroups.TagInstance

ExtractTag() public méthode

Reads a tag's data from the file.
public ExtractTag ( Stream stream, TagInstance tag ) : TagData
stream Stream The stream to read from.
tag TagTool.TagGroups.TagInstance The tag to read.
Résultat TagData

ExtractTagRaw() public méthode

Reads a tag's raw data from the file, including its header.
public ExtractTagRaw ( Stream stream, TagInstance tag ) : byte[]
stream Stream The stream to read from.
tag TagTool.TagGroups.TagInstance The tag to read.
Résultat byte[]

SetTagData() public méthode

Overwrites a tag's data.
public SetTagData ( Stream stream, TagInstance tag, TagData data ) : void
stream Stream The stream to write to.
tag TagTool.TagGroups.TagInstance The tag to overwrite.
data TagData The data to store.
Résultat void

SetTagDataRaw() public méthode

Overwrites a tag's raw data, including its header.
tag
public SetTagDataRaw ( Stream stream, TagInstance tag, byte data ) : void
stream Stream The stream to write to.
tag TagTool.TagGroups.TagInstance The tag to overwrite.
data byte The data to overwrite the tag with.
Résultat void

TagCache() public méthode

Opens a tags.dat file from a stream.
public TagCache ( Stream stream ) : System
stream Stream The stream to open.
Résultat System

UpdateTagOffsets() public méthode

Updates the tag offset table in the file.
public UpdateTagOffsets ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter The stream to write to.
Résultat void