TextChunk
Namespace: Casasoft.IF.GBlorbLib
Represents a text chunk in a Blorb file.
public class TextChunk : Chunk, IChunk
Inheritance Object → Chunk → TextChunk
Implements IChunk
Attributes NullableContextAttribute, NullableAttribute
Properties
Content
Gets or sets the content of the text chunk.
public string Content { get; set; }
Property Value
Name
Gets or sets the name of the chunk.
public string Name { get; set; }
Property Value
Length
Gets or sets the length of the chunk.
public int Length { get; set; }
Property Value
Address
Gets or sets the address of the chunk.
public int Address { get; set; }
Property Value
ResourceID
Gets or sets the resource ID of the chunk.
public int ResourceID { get; set; }
Property Value
Constructors
TextChunk()
Initializes a new instance of the TextChunk class.
public TextChunk()
TextChunk(String)
Initializes a new instance of the TextChunk class with the specified name.
public TextChunk(string name)
Parameters
name
String
The name of the chunk.
TextChunk(Byte[], Int32)
Initializes a new instance of the TextChunk class with the specified data and offset.
public TextChunk(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array containing the chunk data.
offset
Int32
The offset within the byte array where the chunk starts.
TextChunk(String, String)
Initializes a new instance of the TextChunk class with the specified name and content.
public TextChunk(string name, string content)
Parameters
name
String
The name of the chunk.
content
String
The content of the text chunk.
Methods
ToString()
Returns a string that represents the current text chunk.
public string ToString()
Returns
String
A string that represents the current text chunk.
Export(String)
Exports the content of the text chunk to the specified file.
public void Export(string filename)
Parameters
filename
String
The name of the file to export the content to.
Write(Byte[], Int32)
Writes the content of the text chunk to the specified byte array at the given offset.
public void Write(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array to write the content to.
offset
Int32
The offset within the byte array where the content should be written.
IsResource()
Determines whether the text chunk is a resource.
public bool IsResource()
Returns
Boolean
true
if the text chunk is a resource; otherwise, false
.
FileExtension()
Gets the file extension for the text chunk based on its name.
public string FileExtension()
Returns
String
The file extension for the text chunk.
ResourceType()
Gets the resource type of the chunk based on its name.
public string ResourceType()
Returns
String
The resource type as a string.