change "z3950.loc.gov:7090" in documentation YPP-20
[yazpp-moved-to-github.git] / zoom / zquery.cpp
1 // Z39.50 Query classes
2
3 #if HAVE_CONFIG_H
4 #include <config.h>
5 #endif
6 #include "zoom.h"
7
8
9 namespace ZOOM {
10     query::query() : q(ZOOM_query_create()) {
11     }
12     query::~query() {
13         ZOOM_query_destroy(q);
14     }
15
16     prefixQuery::prefixQuery(const std::string &pqn) {
17         if (ZOOM_query_prefix(q, pqn.c_str()) == -1) {
18             throw queryException(queryException::PREFIX, pqn);
19         }
20     }
21
22     // The binding specification says we have to have destructors for
23     // the query subclasses, so in they go -- even though they don't
24     // actually _do_ anything that inheriting the base query type's
25     // destructor wouldn't do.  It's an irritant of C++ that the
26     // declaration of a subclass has to express explicitly the
27     // implementation detail of whether destruction is implemented
28     // by a specific destructor or by inheritance.  Oh well.
29     //
30     // ### Not sure whether I need to do nothing at all, and the
31     // superclass destructor gets called anyway (I think that only
32     // works when you _don't_ define a destructor so that the default
33     // one pertains) or whether I need to duplicate the functionality
34     // of that destructor.  Let's play safe by assuming the latter and
35     // zeroing what we free so that we get bitten if we're wrong.
36     //
37     prefixQuery::~prefixQuery() {
38     }
39
40
41
42     CCLQuery::CCLQuery(const std::string &, void *) {
43         throw "Oops.  No CCL support in ZOOM-C yet.  Sorry.";
44     }
45
46     CCLQuery::~CCLQuery() {
47     }
48 }
49 /*
50  * Local variables:
51  * c-basic-offset: 4
52  * c-file-style: "Stroustrup"
53  * indent-tabs-mode: nil
54  * End:
55  * vim: shiftwidth=4 tabstop=8 expandtab
56  */
57