1 // $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.7 2005-06-25 15:53:21 adam Exp $
3 // Z39.50 Result Set class
9 resultSet::resultSet(connection &c, const query &q) : owner(c) {
10 ZOOM_connection yazc = c._getYazConnection();
11 rs = ZOOM_connection_search(yazc, q._getYazQuery());
13 const char *errmsg; // unused: carries same info as `errcode'
16 if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) {
17 ZOOM_resultset_destroy(rs);
18 throw bib1Exception(errcode, addinfo);
22 resultSet::~resultSet() {
23 ZOOM_resultset_destroy(rs);
26 std::string resultSet::option(const std::string &key) const {
27 return ZOOM_resultset_option_get(rs, key.c_str());
30 bool resultSet::option(const std::string &key, const std::string &val) {
31 ZOOM_resultset_option_set(rs, key.c_str(), val.c_str());
35 size_t resultSet::size() const {
36 return ZOOM_resultset_size(rs);
42 * c-file-style: "Stroustrup"
43 * indent-tabs-mode: nil
45 * vim: shiftwidth=4 tabstop=8 expandtab