Gorgon
Show / Hide Table of Contents

Struct GorgonChunk

A chunk for the chunked file format.

Implements
IGorgonEquatableByRef<GorgonChunk>
IEquatable<GorgonChunk>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: Gorgon.IO
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonChunk : IGorgonEquatableByRef<GorgonChunk>, IEquatable<GorgonChunk>

Constructors

| Edit this page View Source

GorgonChunk(ulong, int, ulong)

Initializes a new instance of the GorgonChunk struct.

Declaration
public GorgonChunk(ulong id, int size, ulong offset)
Parameters
Type Name Description
ulong id

The identifier for the chunk.

int size

The size of the chunk, in bytes.

ulong offset

The offset within the file, in bytes.

Fields

| Edit this page View Source

EmptyChunk

An empty chunk.

Declaration
public static readonly GorgonChunk EmptyChunk
Field Value
Type Description
GorgonChunk
| Edit this page View Source

FileOffset

The offset, in bytes, of the chunk within the chunked file.

Declaration
public readonly ulong FileOffset
Field Value
Type Description
ulong
Remarks

This is relative to the header of the file.

| Edit this page View Source

ID

The ID for the chunk.

Declaration
public readonly ulong ID
Field Value
Type Description
ulong
| Edit this page View Source

Size

The size of the chunk, in bytes.

Declaration
public readonly int Size
Field Value
Type Description
int

Methods

| Edit this page View Source

Equals(GorgonChunk)

Function to compare two instances for equality.

Declaration
public bool Equals(GorgonChunk other)
Parameters
Type Name Description
GorgonChunk other

The object of type GorgonChunk to compare.

Returns
Type Description
bool

true if equal, false otherwise.

| Edit this page View Source

Equals(in GorgonChunk)

Function to compare this instance with another.

Declaration
public bool Equals(in GorgonChunk other)
Parameters
Type Name Description
GorgonChunk other

The other instance to use for comparison.

Returns
Type Description
bool

true if equal, false if not.

| Edit this page View Source

Equals(in GorgonChunk, in GorgonChunk)

Function to compare two instances for equality.

Declaration
public static bool Equals(in GorgonChunk left, in GorgonChunk right)
Parameters
Type Name Description
GorgonChunk left

The first object of type GorgonChunk to compare.

GorgonChunk right

The second object of type GorgonChunk to compare.

Returns
Type Description
bool

true if the specified objects are equal; otherwise, false if not.

| Edit this page View Source

Equals(object)

Determines whether the specified object is equal to this instance.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current instance.

Returns
Type Description
bool

true if the specified object is equal to this instance; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

Returns a hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

ToString()

Returns a string that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents this instance.

Overrides
ValueType.ToString()

Operators

| Edit this page View Source

operator ==(in GorgonChunk, in GorgonChunk)

Operator used to compare two instances for equality.

Declaration
public static bool operator ==(in GorgonChunk left, in GorgonChunk right)
Parameters
Type Name Description
GorgonChunk left

The left instance to compare.

GorgonChunk right

The right instance to compare.

Returns
Type Description
bool

true if equal, false otherwise.

| Edit this page View Source

operator !=(in GorgonChunk, in GorgonChunk)

Operator used to compare two instances for inequality.

Declaration
public static bool operator !=(in GorgonChunk left, in GorgonChunk right)
Parameters
Type Name Description
GorgonChunk left

The left instance to compare.

GorgonChunk right

The right instance to compare.

Returns
Type Description
bool

true if not equal, false otherwise.

Implements

IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author