diff options
| author | fukachan <fukachan> | 2008-06-08 13:09:20 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2008-06-08 13:09:20 +0000 |
| commit | e92d44deb4ce083071ffb9b05edc084d2bcab077 (patch) | |
| tree | b15cbfbc48b78604766b72c5281a215a3bc93a92 | |
| parent | be97ccac3607312f7a697f105958cff5dad6db1b (diff) | |
| download | fml8-e92d44deb4ce083071ffb9b05edc084d2bcab077.tar.gz fml8-e92d44deb4ce083071ffb9b05edc084d2bcab077.tar.bz2 fml8-e92d44deb4ce083071ffb9b05edc084d2bcab077.zip | |
define is_valid_map() method
| -rw-r--r-- | fml/lib/FML/Credential.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fml/lib/FML/Credential.pm b/fml/lib/FML/Credential.pm index 0c3e2e3e..270f25c9 100644 --- a/fml/lib/FML/Credential.pm +++ b/fml/lib/FML/Credential.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Credential.pm,v 1.68 2006/05/09 12:30:32 fukachan Exp $ +# $FML: Credential.pm,v 1.69 2006/11/26 11:59:50 fukachan Exp $ # package FML::Credential; @@ -474,6 +474,30 @@ sub _is_member # Arguments: OBJ($self) STR($map) HASH_REF($config) STR($address) # Side Effects: none # Return Value: NUM(1 or 0) +sub is_valid_map +{ + my ($self, $map, $config) = @_; + my $status = 0; + my $curproc = $self->{ _curproc }; + + use IO::Adapter; + my $io = new IO::Adapter $map, $config; + my $rh = $io->open( { flag => 'r' } ); + if (defined $rh) { + $rh->close(); + return 1; + } + else { + return 0; + } +} + + +# Descriptions: check $map contains $address or not within some ambiguity +# by is_same_address(). +# Arguments: OBJ($self) STR($map) HASH_REF($config) STR($address) +# Side Effects: none +# Return Value: NUM(1 or 0) sub has_address_in_map { my ($self, $map, $config, $address) = @_; |
