-// $Header: /home/cvsroot/yaz++/zoom/zquery.cpp,v 1.4 2002-11-30 22:33:21 mike Exp $
-
// Z39.50 Query classes
#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 string &pqn) {
- q = ZOOM_query_create();
- if (ZOOM_query_prefix(q, pqn.c_str()) == -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
// zeroing what we free so that we get bitten if we're wrong.
//
prefixQuery::~prefixQuery() {
- ZOOM_query_destroy(q);
- q = 0;
}
- CCLQuery::CCLQuery(const 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
+ */
+