diff options
| -rw-r--r-- | fml/doc/ja/01_RFC_IO_ADAPTER.txt | 3 | ||||
| -rw-r--r-- | fml/lib/IO/Adapter/DBI.pm | 17 |
2 files changed, 13 insertions, 7 deletions
diff --git a/fml/doc/ja/01_RFC_IO_ADAPTER.txt b/fml/doc/ja/01_RFC_IO_ADAPTER.txt index 38971c7e..cbe0b5ab 100644 --- a/fml/doc/ja/01_RFC_IO_ADAPTER.txt +++ b/fml/doc/ja/01_RFC_IO_ADAPTER.txt @@ -34,7 +34,8 @@ touch (引数なし) * [要再実装(今はとりあえず使っていない)] - getline () STR ←要拡張? + getline () STR ← implemented. + join by space. get_value_as_str () STR ←要拡張? get_value_as_array_ref () [] ←要拡張? diff --git a/fml/lib/IO/Adapter/DBI.pm b/fml/lib/IO/Adapter/DBI.pm index cdba65d7..d29a73c3 100644 --- a/fml/lib/IO/Adapter/DBI.pm +++ b/fml/lib/IO/Adapter/DBI.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: DBI.pm,v 1.16 2002/07/24 09:30:45 fukachan Exp $ +# $FML: DBI.pm,v 1.17 2002/07/24 11:05:50 fukachan Exp $ # package IO::Adapter::DBI; @@ -176,18 +176,18 @@ same as C<getline()> now. =cut -# Descriptions: get from DBI map +# Descriptions: return a table row as a string sequentially # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: STR sub getline { my ($self, $args) = @_; - croak('getline() not implemented'); + $self->_get_data_from_cache($args, 'getline'); } -# Descriptions: return key from DBI map +# Descriptions: return the primary key in the table sequentially # Arguments: OBJ($self) HASH_REF($args) STR($mode) # Side Effects: none # Return Value: STR @@ -198,10 +198,12 @@ sub get_next_key } -# Descriptions: return value(s) from DBI map +# Descriptions: return value(s) to the primary key in the table +# as ARRAY_REF +# XXX definition is o.k.? # Arguments: OBJ($self) HASH_REF($args) STR($mode) # Side Effects: none -# Return Value: STR +# Return Value: ARRAY_REF sub get_next_value { my ($self, $args) = @_; @@ -241,6 +243,9 @@ sub _get_data_from_cache shift @row; return \@row; } + elsif ($mode eq 'getline') { + return join(" ", @row); + } else { warn("DBI: invalid option"); } |
