In Connection class, rename scan() to scan_pqf() and scan1() to scan1()
[ZOOM-Perl-moved-to-github.git] / lib / ZOOM.pm
index 6268675..eff867d 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ZOOM.pm,v 1.20 2005-11-16 17:26:23 mike Exp $
+# $Id: ZOOM.pm,v 1.23 2005-12-19 17:46:09 mike Exp $
 
 use strict;
 use warnings;
@@ -396,7 +396,7 @@ sub search_pqf {
     return _new ZOOM::ResultSet($this, $pqf, $_rs);
 }
 
-sub scan {
+sub scan_pqf {
     my $this = shift();
     my($startterm) = @_;
 
@@ -405,6 +405,16 @@ sub scan {
     return _new ZOOM::ScanSet($this, $startterm, $_ss);
 }
 
+sub scan {
+    my $this = shift();
+    my($query) = @_;
+
+    my $_ss = Net::Z3950::ZOOM::connection_scan1($this->_conn(),
+                                                $query->_query());
+    $this->_check();
+    return _new ZOOM::ScanSet($this, $query, $_ss);
+}
+
 sub package {
     my $this = shift();
     my($options) = @_;
@@ -577,6 +587,7 @@ sub record_immediate {
     my $_rec = Net::Z3950::ZOOM::resultset_record_immediate($this->_rs(),
                                                            $which);
     $this->{conn}->_check();
+    # The record might legitimately not be there yet
     return undef if !defined $_rec;
 
     return ZOOM::Record->_new($this, $which, $_rec);
@@ -718,7 +729,12 @@ sub _new {
 
     return bless {
        conn => $conn,
-       startterm => $startterm,
+       startterm => $startterm,# This is not currently used, which is
+                               # just as well since it could be
+                               # either a string (when the SS is
+                               # created with scan()) or a
+                               # ZOOM::Query object (when it's
+                               # created with scan1())
        _ss => $_ss,
     }, $class;
 }