Haiku API Bindings
Archivable
Not logged in

Documentation | SupportKit | Archivable

SYNOPSIS

Perl

use HaikuR1::Archivable;

# define MyArchivable subclass here

my $archivable = MyArchivable->new();
my $archive = $flattenable->Archive();

my $unarchived = MyArchivable->new($archive);
# or
my $unarchived = Archivable::instantiate_object($archive);

Python

from HaikuR1.SupportKit import Archivable

# define MyArchivable subclass here

archivable = MyArchivable()
archive = flattenable.Archive()

unarchived = MyArchivable(archive)
# or
unarchived = Archivable.instantiate_object(archive)

DESCRIPTION

Exposes the BArchivable object.

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

METHODS

Constructor

Creates an Archivable.

Perl

my $archivable = HaikuR1::Archivable->new($archive);

Python

archivable = Archivable(archive)

Perl

package MyArchivable;
our @ISA = qw(HaikuR1::Archivable);

sub new {
    my $class = shift;
    my $self = $class->SUPER::new(@_);
    # etc...
    return $self;
}

Python

class MyArchivable(Archivable):
    def __init__(self, msg=None):
        Archivable.__init__(self, msg)
        # etc...

Archive

Stores the Archivable to a Message. Returns the Message or signals an error.

Archive may also be called as a hook; for example, when a Window is archived, its child Views may be archived with it.

Perl

my $archive = $archivable->Archive($deep);

Python

archive = archivable.Archive(deep)

After storing your own information, you should call the base class version.

HOOKS

AllArchived

Called when an Archiver has completely archived the object and any contained archives. May signal an error.

Perl

$archivable->AllArchived($archive);

Python

archivable.AllArchived(archive)

AllUnarchived

Called when an Unarchiver has completely unarchived the object and any contained archives. May signal an error.

Perl

$archivable->AllUnarchived($archive);

Python

archivable.AllUnarchived(archive)

FUNCTIONS

instantiate_object

Called to instantiate an object whose class is unknown. (For example, if you have an archived View, but you're not sure whether it's a Button or a StringView, or some other subclass.) Returns the unarchived object.

Perl

my $unarchived = HaikuR1::Archivable::instantiate_object($from);

Python

unarchived = Archivable.instantiate_object(from)