Pkg.DotNETManifestResources — API for parsing .NET manifest resources

Overview

The Pkg.DotNETManifestResources module contains the API for parsing .NET manifest resources.

Module API

Pkg.DotNETManifestResources module API.

Classes:

DotNETManifestResourceInfo()

This class contains information about a resource entry.

DotNETManifestResourcesObject()

Attributes:

MANRES_TYPE_BOOLEAN

Boolean resource type.

MANRES_TYPE_BYTE

Byte resource type.

MANRES_TYPE_BYTE_ARRAY

Byte-array resource type.

MANRES_TYPE_CHAR

Character resource type.

MANRES_TYPE_DATE_TIME

Date-time resource type.

MANRES_TYPE_DECIMAL

Decimal resource type.

MANRES_TYPE_DOUBLE

Double resource type.

MANRES_TYPE_INT16

16-bit integer resource type.

MANRES_TYPE_INT32

32-bit integer resource type.

MANRES_TYPE_INT64

64-bit integer resource type.

MANRES_TYPE_LAST_PRIMITIVE

Last primitive resource type.

MANRES_TYPE_NULL

Null resource type.

MANRES_TYPE_SBYTE

Signed byte resource type.

MANRES_TYPE_SINGLE

Float resource type.

MANRES_TYPE_STREAM

Stream resource type.

MANRES_TYPE_STRING

String resource type.

MANRES_TYPE_TIME_SPAN

Time-span resource type.

MANRES_TYPE_UINT16

Unsigned 16-bit integer resource type.

MANRES_TYPE_UINT32

Unsigned 32-bit integer resource type.

MANRES_TYPE_UINT64

Unsigned 64-bit integer resource type.

MANRES_TYPE_USER_TYPES

User resource types.

class DotNETManifestResourceInfo

This class contains information about a resource entry.

See also DotNETManifestResourcesObject.GetResourceInfo().

Methods:

TypeName()

Returns the name of the resource type if known; otherwise returns an empty string.

Attributes:

data_offset

The data offset of the resource.

data_size

The data size of the resource.

name

The name of the resource.

offset

The offset of the resource.

resource_offset

The resource value offset.

resource_size

The resource value size.

size

The size of the resource.

type

The resource type (e.g., MANRES_TYPE_BYTE_ARRAY).

TypeName()str
Returns

Returns the name of the resource type if known; otherwise returns an empty string.

Return type

str

data_offset

The data offset of the resource.

data_size

The data size of the resource.

name

The name of the resource.

offset

The offset of the resource.

resource_offset

The resource value offset.

resource_size

The resource value size.

size

The size of the resource.

type

The resource type (e.g., MANRES_TYPE_BYTE_ARRAY).

class DotNETManifestResourcesObject

Bases: Pro.Core.CFFObject

Methods:

GetRawResourceData(i)

Retrieves the raw resource data, which includes the information about the resource.

GetResourceCount()

Returns the number of resources.

GetResourceData(i)

Retrieves the resource data.

GetResourceInfo(i)

Retrieves information about a resource.

GetResourceName(i)

Retrieves the name of a resource.

GetResourceValue(i[, preview])

Retrieves the resource value.

GetResourceValueString(i[, preview])

Retrieves the resource value as string.

Parse([wo])

Parses the format.

GetRawResourceData(i: Union[int, Pkg.DotNETManifestResources.DotNETManifestResourceInfo])Pro.Core.NTContainer

Retrieves the raw resource data, which includes the information about the resource.

Parameters

i (Union[int, DotNETManifestResourceInfo]) – Either the resource index or the resource information.

Returns

Returns the data if successful; otherwise returns an invalid container instance.

Return type

NTContainer

See also GetResourceData() and GetResourceInfo().

GetResourceCount()int
Returns

Returns the number of resources.

Return type

int

See also GetResourceInfo().

GetResourceData(i: Union[int, Pkg.DotNETManifestResources.DotNETManifestResourceInfo])Pro.Core.NTContainer

Retrieves the resource data.

Parameters

i (Union[int, DotNETManifestResourceInfo]) – Either the resource index or the resource information.

Returns

Returns the data if successful; otherwise returns an invalid container instance.

Return type

NTContainer

See also GetRawResourceData() and GetResourceInfo().

GetResourceInfo(i: int)Optional[Pkg.DotNETManifestResources.DotNETManifestResourceInfo]

Retrieves information about a resource.

Parameters

i (int) – The resource index.

Returns

Returns the resource information if successful; otherwise returns None.

Return type

Optional[DotNETManifestResourceInfo]

See also GetResourceCount() and GetResourceData().

GetResourceName(i: int)str

Retrieves the name of a resource.

Parameters

i (int) – The resource index.

Returns

Returns the name if successful; otherwise returns an empty string.

Return type

str

See also GetResourceCount().

GetResourceValue(i: Union[int, Pkg.DotNETManifestResources.DotNETManifestResourceInfo], preview: bool = False)Any

Retrieves the resource value.

Parameters
  • i (Union[int, DotNETManifestResourceInfo]) – Either the resource index or the resource information.

  • preview (bool) – If True and the resource contains a large amount of data, only a chunk of the data will be returned; otherwise the entire data is returned.

Returns

Returns the value if successful; otherwise returns None.

Return type

Any

See also GetResourceValueString() and GetResourceCount().

GetResourceValueString(i: Union[int, Pkg.DotNETManifestResources.DotNETManifestResourceInfo], preview: bool = False)str

Retrieves the resource value as string.

Parameters
  • i (Union[int, DotNETManifestResourceInfo]) – Either the resource index or the resource information.

  • preview (bool) – If True and the resource contains a large amount of data, only a chunk of the data will be returned; otherwise the entire data is returned.

Returns

Returns the value as string if successful; otherwise returns an empty string.

Return type

Any

See also GetResourceValue() and GetResourceCount().

Parse(wo: Optional[Pro.Core.NTIWait] = None)bool

Parses the format.

Parameters

wo (NTIWait) – An optional wait object for the parsing process.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

MANRES_TYPE_BOOLEAN

Boolean resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_BYTE

Byte resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_BYTE_ARRAY

Byte-array resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_CHAR

Character resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_DATE_TIME

Date-time resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_DECIMAL

Decimal resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_DOUBLE

Double resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_INT16

16-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_INT32

32-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_INT64

64-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_LAST_PRIMITIVE

Last primitive resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_NULL

Null resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_SBYTE

Signed byte resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_SINGLE

Float resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_STREAM

Stream resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_STRING

String resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_TIME_SPAN

Time-span resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_UINT16

Unsigned 16-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_UINT32

Unsigned 32-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_UINT64

Unsigned 64-bit integer resource type.

See also DotNETManifestResourceInfo.type.

MANRES_TYPE_USER_TYPES

User resource types.

See also DotNETManifestResourceInfo.type.