Haiku API Bindings
NodeInfo
Not logged in

Documentation | StorageKit | NodeInfo

NAME

NodeInfo

VERSION

0.01

SYNOPSIS

Perl

use HaikuR1::NodeInfo;

my $info = HaikuR1::NodeInfo->new($node);
my $app = $info->GetPreferredApp();

Python

from HaikuR1.SotrageKit import NodeInfo

info = NodeInfo(node)
app = info.GetPreferredApp()

DESCRIPTION

Exposes the BNodeInfo object.

For more information on NodeInfo, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a NodeInfo.

Perl

HaikuR1::NodeInfo->new($node);
HaikuR1::NodeInfo->new();

Python

NodeInfo(node)
NodeInfo()

App hint

GetAppHint

SetAppHint

Gets or sets the application hint for the node. This is a path on the file system, not an application signature, so this may break if the file is moved.

Perl

$nodeinfo->GetAppHint();
$nodeinfo->SetAppHint($ref);

Python

nodeinfo.GetAppHint()
nodeinfo.SetAppHint(ref)

Icon

GetIcon

SetIcon

Gets the volume's icon. If you pass a size, then it returns a Bitmap; otherwise, it returns two items: the raw icon data and the type.

(Currently the type is always B_VECTOR_ICON_TYPE.)

Perl

$nodeinfo->GetIcon($size, $colorSpace);
$nodeinfo->GetIcon();
$nodeinfo->SetIcon($icon);
$nodeinfo->SetIcon($data);

Python

nodeinfo.GetIcon(size, colorSpace)
nodeinfo.GetIcon()
nodeinfo.SetIcon(icon)
nodeinfo.SetIcon(data)

Preferred App

GetPreferredApp

SetPreferredApp

Gets or sets the preferred application for the node (i.e., the file, folder, or symlink found at the node).

Perl

$nodeinfo->GetPreferredApp($verb);
$nodeinfo->SetPreferredApp($signature, $verb);

Python

nodeinfo.GetPreferredApp(verb)
nodeinfo.SetPreferredApp(signature, verb)

SetTo

SetTo Updates the NodeInfo object to refer to the given node. refers to any node.

Perl

$nodeinfo->SetTo($node);

Python

nodeinfo.SetTo(node)

Type

GetType

SetType

Gets or sets the MIME type for the node.

Perl

$nodeinfo->GetType();
$nodeinfo->SetType($type);

Python

nodeinfo.GetType()
nodeinfo.SetType(type)

CLASS METHODS

GetTrackerIcon

Gets the icon used by Tracker to represent the node.

Perl

HaikuR1::NodeInfo->GetTrackerIcon($ref, $size, $colorSpace);
$nodeinfo->GetTrackerIcon($size, $colorSpace);

Python

NodeInfo.GetTrackerIcon(ref, size, colorSpace)
NodeInfo.GetTrackerIcon(nodeinfo, size, colorSpace)

Perl

The Perl version functions as both a class method and an instance method, so you call the method on nodeinfo instead of passing it as the first parameter.