#
#
#
# Object.pm contains perl code for exacct object manipulation.
#
require 5.8.4;
use strict;
use warnings;
our $VERSION = '1.3';
use XSLoader;
@EXPORT_OK = @_Constants;
use base qw(Exporter);
#
# Class methods
#
#
# Dump an exacct object to the specified filehandle, or STDOUT by default.
#
sub dump
{
# Fettle parameters.
$indent ||= 0;
# Check for undef values.
if (! defined($obj)) {
return;
}
# Deal with items.
printf $fh ("%sITEM\n%s Catalog = %s|%s|%s\n",
$indent++;
# Recursively dump nested objects.
if (ref($val)) {
# Just print out items.
} else {
}
# Deal with groups.
} else {
printf $fh ("%sGROUP\n%s Catalog = %s|%s|%s\n",
$indent++;
}
}
}
#
# Item subclass - establish inheritance.
#
#
# Group subclass - establish inheritance.
#
#
# Tied array used for holding a group's items.
#
use Carp;
#
# Check the passed list of arguments are derived from ::Object
#
sub check_args
{
my @duff;
foreach my $i (@_) {
push(@duff, $i)
}
if (@duff) {
' not of type Sun::Solaris::Exacct::Object');
}
}
#
# Tied hash access methods
#
sub TIEARRAY
{
return(bless([], $_[0]));
}
sub FETCHSIZE
{
return(scalar(@{$_[0]}));
}
sub STORESIZE
{
$#{$_[0]} = $_[1] - 1;
}
sub STORE
{
check_args($_[2]);
}
sub FETCH
{
return($_[0]->[$_[1]]);
}
sub CLEAR
{
@{$_[0]} = ();
}
sub POP
{
return(pop(@{$_[0]}));
}
sub PUSH
{
my $a = shift(@_);
check_args(@_);
push(@$a, copy_xs_ea_objects(@_));
}
sub SHIFT
{
return(shift(@{$_[0]}));
}
sub UNSHIFT
{
my $a = shift(@_);
check_args($_[2]);
return(unshift(@$a, copy_xs_ea_objects(@_)));
}
sub EXISTS
{
return(exists($_[0]->[$_[1]]));
}
sub DELETE
{
return(delete($_[0]->[$_[1]]));
}
sub EXTEND
{
}
sub SPLICE
{
my $a = shift(@_);
my $sz = scalar(@$a);
my $off = @_ ? shift(@_) : 0;
check_args(@_);
}
1;