Documentation | StorageKit | Volume
SYNOPSIS
Perl
use HaikuR1::Volume; $volume->GetName();
Python
import HaikuR1.Volume volume.GetName()
DESCRIPTION
Exposes the BVolume
object.
For more information on Volume, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a Volume.
Perl
HaikuR1::Volume->new(); HaikuR1::Volume->new($device); HaikuR1::Volume->new($volume);
Python
Volume() Volume(device) Volume(volume)
device
A device id.
volume
A Volume to copy.
copy
Copies the contents of another object into this object.
Perl
$volume->copy($copy_from);
Python
volume.copy(copy_from)
copy_from
A Volume to copy.
Device
SetTo
Unset
Points the Volume object to a different volume.
Perl
$volume->Device(); $volume->SetTo($device); $volume->Unset();
Python
volume.Device() volume.SetTo(device) volume.Unset()
device
A device id.
GetIcon
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
$volume->GetIcon($size, $colorSpace); $volume->GetIconData();
Python
volume.GetIcon(size, colorSpace) volume.GetIconData()
size
An integer icon size constant.
colorSpace
An integer color space constant, the color space of the returned Bitmap; defaults to
B_RGBA32
.
GetRootDirectory
Returns the root Directory.
Perl
$volume->GetRootDirectory();
Python
volume.GetRootDirectory()
Name
GetName
SetName
Gets or sets the volume name.
Perl
$volume->GetName(); $volume->SetName($name);
Python
volume.GetName() volume.SetName(name)
name
A string, the new name.
Properties
Capacity
FreeBytes
BlockSize
IsRemovable
IsReadOnly
IsPersistent
IsShared
KnowsMime
KnowsAttr
KnowsQuery
Most of these methods do what you expect. The Knows
methods refer to
properties of the file system on the volume: whether it uses MIME for file
types, whether its files have attributes, and whether it can respond to
queries.
Perl
$volume->Capacity(); $volume->FreeBytes(); $volume->BlockSize(); $volume->IsRemovable(); $volume->IsReadOnly(); $volume->IsPersistent(); $volume->IsShared(); $volume->KnowsMime(); $volume->KnowsAttr(); $volume->KnowsQuery();
Python
volume.Capacity() volume.FreeBytes() volume.BlockSize() volume.IsRemovable() volume.IsReadOnly() volume.IsPersistent() volume.IsShared() volume.KnowsMime() volume.KnowsAttr() volume.KnowsQuery()
OPERATORS
==
Returns true if the Volume objects refer to the same volume.
!=
Returns true if the Volume objects do not refer to the same volume.