AtviseFile
Extends:
An extension to vinyl~File providing some additional, atvise-related properties.
Test:
Static Method Summary
Static Public Methods | ||
public static |
decodeValue(buffer: Buffer, dataType: node-opcua~DataType, arrayType: node-opcua~VariantArrayType): * Decodes a file's contents to a node's value. |
|
public static |
encodeValue(value: *, dataType: node-opcua~DataType, arrayType: node-opcua~VariantArrayType): Buffer Encodes a node's value to file contents. |
|
public static |
fromReadResult(readResult: ReadStream.ReadResult): AtviseFile Creates a new AtviseFile for the given ReadStream.ReadResult. |
|
public static |
normalizeMtime(date: Date): Date As file mtimes do not support millisecond resolution these must be removed before storing files. |
|
public static |
pathForReadResult(readResult: ReadStream.ReadResult): * Returns a storage path for a ReadStream.ReadResult. |
|
public static |
Creates a new AtviseFile and reads it's contents. |
Member Summary
Public Members | ||
public get |
The file's node-opcua~VariantArrayType. |
|
public |
contents: Buffer The file's contents. |
|
public get |
Returns the decoded node value for create node serverscript. |
|
public get |
The file's node-opcua~DataType. |
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
A file's browse and display name. |
|
public get |
The node's class. |
|
public get |
Returns the node id associated with the file. |
|
public get |
A file's parent's node id. |
|
public get |
references: Map<string, NodeId|NodeId[]> The files's references. |
|
public get |
The file's type definition. |
|
public set |
value(newValue: *) Sets the node value for the file. |
|
public get |
value: * Returns the decoded node value for the file. |
Private Members | ||
private |
The node's stored node-opcua~VariantArrayType. |
|
private |
The node's stored node-opcua~DataType. |
|
private |
A node's browse- and display name. |
|
private |
The node's class. |
|
private |
_references: Map<String, NodeId[]> References the node holds: In most cases this will be a single entry for
|
Method Summary
Public Methods | ||
public |
clone(options: Object): AtviseFile Returns a new file with all attributes of the current file. |
|
public |
Computes a file's metadata if needed. |
Private Methods | ||
private |
Recalculates AtviseFile#dataType, AtviseFile#arrayType and AtviseFile#typeDefinition. |
Static Public Methods
public static decodeValue(buffer: Buffer, dataType: node-opcua~DataType, arrayType: node-opcua~VariantArrayType): * source
Decodes a file's contents to a node's value.
Params:
Name | Type | Attribute | Description |
buffer | Buffer | The file contents to decode. |
|
dataType | node-opcua~DataType | The node-opcua~DataType to decode the contents. |
|
arrayType | node-opcua~VariantArrayType | The files array type. |
Return:
* (nullable: true) | The decoded node value or null. |
Test:
public static encodeValue(value: *, dataType: node-opcua~DataType, arrayType: node-opcua~VariantArrayType): Buffer source
Encodes a node's value to file contents.
Params:
Name | Type | Attribute | Description |
value | * | The value to encode. |
|
dataType | node-opcua~DataType | The node-opcua~DataType to encode the value for. |
|
arrayType | node-opcua~VariantArrayType | The files array type. |
Return:
Buffer (nullable: true) | The encoded file contents or null. |
Test:
public static fromReadResult(readResult: ReadStream.ReadResult): AtviseFile source
Creates a new AtviseFile for the given ReadStream.ReadResult.
Params:
Name | Type | Attribute | Description |
readResult | ReadStream.ReadResult | The read result to create the file for. |
public static normalizeMtime(date: Date): Date source
As file mtimes do not support millisecond resolution these must be removed before storing files.
Params:
Name | Type | Attribute | Description |
date | Date | The original mtime. |
public static pathForReadResult(readResult: ReadStream.ReadResult): * source
Returns a storage path for a ReadStream.ReadResult.
Params:
Name | Type | Attribute | Description |
readResult | ReadStream.ReadResult | The read result to get a path for. |
Return:
* |
public static read(options: Object): Promise source
Creates a new AtviseFile and reads it's contents.
Params:
Name | Type | Attribute | Description |
options | Object | See vinyl~File for available options. |
Return:
Promise | Resolved with the new file of rejected with the error that occured while trying to read it's path. |
Test:
Public Members
public get arrayType: node-opcua~VariantArrayType source
The file's node-opcua~VariantArrayType.
Test:
public get isReferenceConfig: boolean source
true
for reference config files (for example .index.htm.json
).
Private Members
private _arrayType: node-opcua~VariantArrayType source
The node's stored node-opcua~VariantArrayType.
Public Methods
public clone(options: Object): AtviseFile source
Returns a new file with all attributes of the current file.
Params:
Name | Type | Attribute | Description |
options | Object | See the vinyl~File docs for all options available. |
Test:
Private Methods
private _getMetadata() source
Recalculates AtviseFile#dataType, AtviseFile#arrayType and AtviseFile#typeDefinition. Never call this method directly..