diff options
| author | fukachan <fukachan> | 2001-02-25 06:43:41 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-02-25 06:43:41 +0000 |
| commit | a2cc40f14d32f8f38fff0391d91ea9c0d64315ec (patch) | |
| tree | 0f62e4ed29a02342083a4d8271c63be7a305eb04 /fml/lib/IO/Adapter/File.pm | |
| parent | 39d104d1caf304a154d3c9f1caa7601152510667 (diff) | |
| download | fml8-a2cc40f14d32f8f38fff0391d91ea9c0d64315ec.tar.gz fml8-a2cc40f14d32f8f38fff0391d91ea9c0d64315ec.tar.bz2 fml8-a2cc40f14d32f8f38fff0391d91ea9c0d64315ec.zip | |
clean up documents
move FML::String to Dialect::ISO2022JP (Dialect::Japanese::String)
Diffstat (limited to 'fml/lib/IO/Adapter/File.pm')
| -rw-r--r-- | fml/lib/IO/Adapter/File.pm | 87 |
1 files changed, 73 insertions, 14 deletions
diff --git a/fml/lib/IO/Adapter/File.pm b/fml/lib/IO/Adapter/File.pm index a6b16c8f..ef2e4c85 100644 --- a/fml/lib/IO/Adapter/File.pm +++ b/fml/lib/IO/Adapter/File.pm @@ -14,6 +14,33 @@ use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; +=head1 NAME + +IO::Adapter::File - functions to do IO for a file + +=head1 SYNOPSIS + + $map = 'file:/some/where/file'; + + use IO::MapAdapter; + $obj = new IO::MapAdapter $map; + $obj->open || croak("cannot open $map"); + while ($x = $obj->getline) { ... } + $obj->close; + +=head1 DESCRIPTION + +This module provides real IO functions for a file used in IO::MapAdapter. +The map is the fully pathed file name or a file name 'file:/' prefix. + +=head1 METHODS + +=head2 C<new()> + +standard constructor + +=cut + sub new { @@ -24,6 +51,15 @@ sub new } +=head2 C<open($args)> + +$args HASH REFERENCE has two parameters. +C<file> is the target file to open. +C<flag> is the mode of open(). + +=cut + + sub open { my ($self, $args) = @_; @@ -50,6 +86,19 @@ my $ec = 0; sub line_count { my ($self) = @_; return "${ec}/${c}";} +=head2 C<getline()> + +return one line. +It is the same as usual getline() call for a file. + +=head2 C<get_next_value()> + +return one line suitable with C<fml> IO design. +This is used in C<fml5>. + +=cut + + sub getline { my ($self) = @_; @@ -90,6 +139,17 @@ sub get_next_value } +=head2 C<getpos()> + +get the position in the opened file. + +=head2 C<setpos(pos)> + +set the position in the opened file. + +=cut + + sub getpos { my ($self) = @_; @@ -106,6 +166,17 @@ sub setpos } +=head2 C<eof()> + +Eof Of File? + +=head2 C<close()> + +close the opended file. + +=cut + + sub eof { my ($self) = @_; @@ -121,21 +192,9 @@ sub close } -=head1 NAME - -IO::Adapter::File.pm - what is this - -=head1 SYNOPSIS - -=head1 DESCRIPTION - -=head1 CLASSES - -=head1 METHODS - -=item C<new()> +=head1 SEE ALSO -... what is this ... +L<IO::MapAdapter> =head1 AUTHOR |
