Win32::Palm::Install::UsersDat::UserEntry - Class to hold user information


Win32-Palm-Install documentation Contained in the Win32-Palm-Install distribution.

Index


Code Index:

NAME

Top

Win32::Palm::Install::UsersDat::UserEntry - Class to hold user information

VERSION

Top

This document refers to version 0.2 of Win32::Palm::Install::UsersDat::UserEntry, released 25 september 2001.

SYNOPSIS

Top

	use Win32::Palm::Install::UsersDat::UserEntry;

	my $ue = Win32::Palm::Install::UserDat::UserEntry->new(
			-HotsyncID 	=> $hotsyncid,
			-LongName	=> $longname,
			-DirName	=> $dirname,
			-Active		=> $active,
			-Password	=> $password
	);

DESCRIPTION

Top

A module to hold the information of a UserEntry in a users.dat file.

Class and Object methods

Top

	get_HotsyncID / set_HotsyncID
	get_LongName / set_LongName
	get_Password / set_Password
	get_DirName / set_DirName
	get_Active / set_Activea

AUTHOR

Top

Johan Van den Brande <johan@vandenbrande.com>

COPYRIGHT

Top


Win32-Palm-Install documentation Contained in the Win32-Palm-Install distribution.

package Win32::Palm::Install::UsersDat::UserEntry;
$VERSION = 0.1;
use strict;
use Carp;
use vars '$AUTOLOAD';


{
# Encapsulated class data

	my %attr_data = (
		_HotsyncID	=> 1,
		_LongName	=> 1,
		_DirName	=> 1,
		_Active		=> 1,
		_Password	=> 1
			);	
}

sub new {
	my ($proto, %args) = @_;
	my $class = ref($proto) || $proto;
	
	my $self = {
			_HotsyncID	=> $args{-HotsyncID},
			_LongName	=> $args{-LongName},
			_DirName	=> $args{-DirName},
			_Active		=> $args{-Active},
			_Password	=> $args{-Password}
		   };

	bless $self, $class;
}

sub AUTOLOAD {
	no strict 'refs';
	my ($self, $newval) = @_;

	return if $AUTOLOAD =~ /::DESTROY$/;

	# get_ method
	if ($AUTOLOAD =~ /.*::get(_\w+)/ )
	{
		my $attr_name = $1;
		*{$AUTOLOAD} = sub { return $_[0]->{$attr_name} };
		return $self->{$attr_name};
	}

	# set_ method
	if ($AUTOLOAD =~ /.*::set(_\w+)/ )
	{
		my $attr_name = $1;
		*{$AUTOLOAD} = sub { $_[0]->{$attr_name} = $_[1]; return };
		$self->{$attr_name} = $newval;
		return; 
	}
	croak "No such method: $AUTOLOAD";	
}

1;