X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzquery.cpp;h=704a20fda89f09631423f65affb0083cf6b4a9b1;hb=6d00ed0733857815bfe3eb2779b99bdd3f2049fe;hp=cd937c23488420bec5aa02918d85cc6d3519aa77;hpb=01126607d1b475f43b29548dbd98f199f8e9f57f;p=yazpp-moved-to-github.git diff --git a/zoom/zquery.cpp b/zoom/zquery.cpp index cd937c2..704a20f 100644 --- a/zoom/zquery.cpp +++ b/zoom/zquery.cpp @@ -1,22 +1,22 @@ -// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.5 2003-07-02 10:25:13 adam Exp $ - // Z39.50 Query classes +#if HAVE_CONFIG_H +#include +#endif #include "zoom.h" namespace ZOOM { + query::query() : q(ZOOM_query_create()) { + } query::~query() { - ZOOM_query_destroy(q); - q = 0; + ZOOM_query_destroy(q); } prefixQuery::prefixQuery(const std::string &pqn) { - q = ZOOM_query_create(); - if (ZOOM_query_prefix(q, pqn.c_str()) == -1) { - ZOOM_query_destroy(q); - throw queryException(queryException::PREFIX, 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 @@ -35,18 +35,23 @@ 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 std::string &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 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +