X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzquery.cpp;h=8bc757ade2812a2221ac2f908386abb281729487;hb=16dba5340834b1c35523bb1fb92355e9f56fe0f0;hp=154e3ce18d65e72e52eba8ce0114d08240d44a3e;hpb=b8248fc2b2eb866a23a677135deb4633cb1f3322;p=yazpp-moved-to-github.git diff --git a/zoom/zquery.cpp b/zoom/zquery.cpp index 154e3ce..8bc757a 100644 --- a/zoom/zquery.cpp +++ b/zoom/zquery.cpp @@ -1,4 +1,4 @@ -// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.3 2002-10-09 09:07:10 mike Exp $ +// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.7 2005-06-25 15:53:21 adam Exp $ // Z39.50 Query classes @@ -6,19 +6,16 @@ namespace ZOOM { + query::query() : q(ZOOM_query_create()) { + } query::~query() { - ZOOM_query_destroy(q); - q = 0; + ZOOM_query_destroy(q); } - - - prefixQuery::prefixQuery(const char *pqn) { - q = ZOOM_query_create(); - if (ZOOM_query_prefix(q, pqn) == -1) { - ZOOM_query_destroy(q); - throw queryException(queryException::PREFIX, pqn); - } + prefixQuery::prefixQuery(const std::string &pqn) { + if (ZOOM_query_prefix(q, pqn.c_str()) == -1) { + throw queryException(queryException::PREFIX, pqn); + } } // The binding specification says we have to have destructors for @@ -37,18 +34,22 @@ 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) { - throw "Oops. No CCL support in ZOOM-C yet. Sorry."; + CCLQuery::CCLQuery(const std::string &, void *) { + throw "Oops. No CCL support in ZOOM-C yet. Sorry."; } CCLQuery::~CCLQuery() { - ZOOM_query_destroy(q); - q = 0; } } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +