Skip to content

Latest commit

 

History

History
215 lines (122 loc) · 4.11 KB

ApeTagItem.md

File metadata and controls

215 lines (122 loc) · 4.11 KB

node-taglib-sharp / Exports / ApeTagItem

Class: ApeTagItem

Class that represents a property in an APE tag.

Table of contents

Accessors

Methods

Accessors

isEmpty

get isEmpty(): boolean

Gets whether the current instance is empty.

Returns

boolean


isReadOnly

get isReadOnly(): boolean

Gets whether the current instance is flagged as read-only on disk.

Returns

boolean


key

get key(): string

Gets the key that specified the contents of the item.

Remarks

This value is used for specifying the contents of the item in a common and consistent fashion. For example, TITLE specifies that the item contains the title of the track.

Returns

string


size

get size(): number

Size of the current instance as it last appeared on disk.

Returns

number


text

get text(): string[]

Gets the string values stored in the current item, if the current item is a text item, or an empty array if the current item is a binary item or no text is stored.

Returns

string[]


type

get type(): ApeTagItemType

Gets the type of value contained in the current instance.

Returns

ApeTagItemType


value

get value(): ByteVector

Gets the binary value stored in the current item, if the current item is a binary item, or undefined if the current item is a text item.

Returns

ByteVector

Methods

clone

clone(): ApeTagItem

Creates a deep copy of the current instance.

Returns

ApeTagItem


render

render(): ByteVector

Renders the current instance as an APEv2 item.

Returns

ByteVector


toString

toString(): string

Gets the contents of the current instance as a string. If the current instance is binary or does not have a text array, undefined will be returned. Otherwise, the text values will be joined into a single, comma separated list.

Returns

string


fromBinaryValue

Static fromBinaryValue(key, value): ApeTagItem

Constructs and initializes a new instance of ApeTagItem with a specified key and binary data to use as the value.

Parameters

Name Type Description
key string Key to use for the item
value ByteVector Binary data to store as the value

Returns

ApeTagItem


fromData

Static fromData(data, offset): ApeTagItem

Constructs a new instance of ApeTagItem by reading in a raw APEv2 item.

Parameters

Name Type Description
data ByteVector ByteVector containing the item to read
offset number Index into data at which to begin reading the item data. Must be a positive 32-bit integer.

Returns

ApeTagItem


fromTextValues

Static fromTextValues(key, ...values): ApeTagItem

Constructs and initializes a new instance of ApeTagItem with a specified key and collection of text values.

Parameters

Name Type Description
key string Key to use for the item
...values string[] Values to store in the item

Returns

ApeTagItem