X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzquery.cpp;h=d2f699d2bb2386aa0238f878b48ffc8f3ed34e35;hb=9a7474140eb5aaaba2b50cbf8354eb3e5e2b813e;hp=77c0d938863f52866fea2dd2a9970ed0a3c654ad;hpb=8e0f7888835eb1a84882b440209ec125ce5856c1;p=yazpp-moved-to-github.git diff --git a/zoom/zquery.cpp b/zoom/zquery.cpp index 77c0d93..d2f699d 100644 --- a/zoom/zquery.cpp +++ b/zoom/zquery.cpp @@ -1,23 +1,20 @@ -// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.1 2002-08-08 13:31:54 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.6 2003-09-22 13:01:54 mike Exp $ // Z39.50 Query classes -#include "zoom++.h" +#include "zoom.h" namespace ZOOM { + query::query() : q(ZOOM_query_create()) { + } query::~query() { ZOOM_query_destroy(q); - q = 0; } - - - prefixQuery::prefixQuery(const char *pqn) { - q = ZOOM_query_create(); - if (ZOOM_query_prefix(q, pqn) == -1) { - ZOOM_query_destroy(q); - throw queryError(queryError::PREFIX, pqn); + prefixQuery::prefixQuery(const std::string &pqn) { + if (ZOOM_query_prefix(q, pqn.c_str()) == -1) { + throw queryException(queryException::PREFIX, pqn); } } @@ -37,18 +34,14 @@ namespace ZOOM { // zeroing what we free so that we get bitten if we're wrong. // prefixQuery::~prefixQuery() { - ZOOM_query_destroy(q); - q = 0; } - CCLQuery::CCLQuery(const char *ccl, void *qualset) { + CCLQuery::CCLQuery(const std::string &, void *) { throw "Oops. No CCL support in ZOOM-C yet. Sorry."; } CCLQuery::~CCLQuery() { - ZOOM_query_destroy(q); - q = 0; } }