Table of Contents

PstNodeId Struct

Definition

Namespace
Bodu.IO.Pst
Assembly
Bodu.IO.Pst.dll
Package
Bodu.IO.Pst 0.7.1
Source
PstNodeId.cs

Represents a 32-bit node identifier: five type bits in the low positions and a 27-bit index above them (MS-PST §2.2.2.1).

public readonly struct PstNodeId : IEquatable<PstNodeId>
Implements
Inherited Members
Extension Methods

Remarks

A handful of fixed identifiers anchor every file - MessageStore (0x21), NameToIdMap (0x61), and RootFolder (0x122) - and are exposed here as well-known values.

Constructors

PstNodeId(PstNodeType, uint)

Initializes a new instance of the PstNodeId struct from a type and index.

public PstNodeId(PstNodeType type, uint index)

Parameters

type PstNodeType

The node type (the five low bits).

index uint

The 27-bit index.

PstNodeId(uint)

Initializes a new instance of the PstNodeId struct from a raw 32-bit identifier.

public PstNodeId(uint value)

Parameters

value uint

The raw identifier.

Properties

Index

Gets the 27-bit index.

public uint Index { get; }

Property Value

uint

The index above the type bits.

MessageStore

Gets the message-store node identifier (NID_MESSAGE_STORE, 0x21).

public static PstNodeId MessageStore { get; }

Property Value

PstNodeId

The well-known identifier.

NameToIdMap

Gets the named-property mapping node identifier (NID_NAME_TO_ID_MAP, 0x61).

public static PstNodeId NameToIdMap { get; }

Property Value

PstNodeId

The well-known identifier.

RootFolder

Gets the root folder node identifier (NID_ROOT_FOLDER, 0x122).

public static PstNodeId RootFolder { get; }

Property Value

PstNodeId

The well-known identifier.

Type

Gets the node type carried in the five low bits.

public PstNodeType Type { get; }

Property Value

PstNodeType

The PstNodeType of the node.

Value

Gets the raw 32-bit identifier.

public uint Value { get; }

Property Value

uint

The raw value: type in the five low bits, index above.

Methods

Equals(PstNodeId)

Determines whether this identifier carries the same raw value as another.

public bool Equals(PstNodeId other)

Parameters

other PstNodeId

The identifier to compare with.

Returns

bool

true when both carry the same Value.

Equals(object?)

Determines whether this identifier equals another object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is an equal PstNodeId.

GetHashCode()

Returns a hash code consistent with Equals(PstNodeId).

public override int GetHashCode()

Returns

int

A hash code computed over the raw value.

ToString()

Returns the canonical hexadecimal form of the identifier.

public override string ToString()

Returns

string

The raw value as 0x followed by eight upper-case hexadecimal digits.

Operators

operator ==(PstNodeId, PstNodeId)

Determines whether two identifiers carry the same raw value.

public static bool operator ==(PstNodeId left, PstNodeId right)

Parameters

left PstNodeId

The first identifier.

right PstNodeId

The second identifier.

Returns

bool

true when the identifiers are equal.

operator !=(PstNodeId, PstNodeId)

Determines whether two identifiers carry different raw values.

public static bool operator !=(PstNodeId left, PstNodeId right)

Parameters

left PstNodeId

The first identifier.

right PstNodeId

The second identifier.

Returns

bool

true when the identifiers differ.

Applies to

ProductVersions
.NET8, 10