Remove unused top-level diagnostic functions.
[yazpp-moved-to-github.git] / zoom / master-header
1 // $Id: master-header,v 1.10 2002-11-13 11:48:07 mike Exp $
2 //
3 // ZOOM C++ Binding.
4 // The ZOOM homepage is at http://zoom.z3950.org/
5 //
6 // Derived from version 1.0g at
7 //      http://zoom.z3950.org/bind/cplusplus/zoom-1.0g.hh
8
9 #include <stddef.h>             // for size_t
10
11 */*
12 * * This is a bit stupid.  The fact that our ZOOM-C++ implementation is
13 * * based on the ZOOM-C implementation is our Dirty Little Secret, and
14 * * there is in principle no reason why client code need be bothered
15 * * with it.  Except of course that the public class declarations in
16 * * C++ have to lay their private parts out for the world to see
17 * * (oo-er).  Hence the inclusion of <yaz/zoom.h>
18 * */
19 *#include <yaz/zoom.h>
20 *
21 namespace ZOOM {
22   // Forward declarations for type names.
23   class YAZ_EXPORT query;
24   class YAZ_EXPORT resultSet;
25   class YAZ_EXPORT record;
26
27   const char *option (const char *key);
28   const char *option (const char *key, const char *val);
29
30   class YAZ_EXPORT connection {
31 *   ZOOM_connection c;
32 *   friend class resultSet; // so it can use _getYazConnection()
33 *   ZOOM_connection _getYazConnection () const { return c; }
34   public:
35     connection (const char *hostname, int portnum);
36     ~connection ();
37     const char *option (const char *key) const;
38     const char *option (const char *key, const char *val);
39   };
40
41   class query {
42       // pure virtual class: derive concrete subclasses from it.
43 *   friend class resultSet; // so it can use _getYazQuery()
44 *   ZOOM_query _getYazQuery () const { return q; }
45 * protected:
46 *   ZOOM_query q;
47   public:
48     virtual ~query ();
49   };
50
51   class YAZ_EXPORT prefixQuery : public query {
52   public:
53     prefixQuery (const char *pqn);
54     ~prefixQuery ();
55   };
56
57   class YAZ_EXPORT CCLQuery : public query {
58   public:
59     CCLQuery (const char *ccl, void *qualset);
60     ~CCLQuery ();
61   };
62
63   class YAZ_EXPORT resultSet {
64 *   connection &owner;
65 *   ZOOM_resultset rs;
66   public:
67     resultSet (connection &c, const query &q);
68     ~resultSet ();
69     const char *option (const char *key) const;
70     const char *option (const char *key, const char *val);
71     size_t size () const;
72     const record *getRecord (size_t i) const;
73   };
74
75   class YAZ_EXPORT record {
76 *   const resultSet *owner;
77 *   ZOOM_record r;
78 *   friend class resultSet; // so it can use this constructor
79 *   record::record (const resultSet *rs, ZOOM_record rec):
80 *       owner (rs), r (rec) {}
81   public:
82     ~record ();
83     enum syntax {
84       UNKNOWN, GRS1, SUTRS, USMARC, UKMARC, XML
85     };
86     record *clone () const;
87     syntax recsyn () const;
88     const char *render () const;
89     const char *rawdata () const;
90   };
91
92   class YAZ_EXPORT exception {
93 * protected:
94 *   int code;
95   public:
96     exception (int code);
97     int errcode () const;
98     const char *errmsg () const;
99   };
100
101   class YAZ_EXPORT systemException: public exception {
102   public:
103     systemException ();
104     const char *errmsg () const;
105   };
106
107   class YAZ_EXPORT bib1Exception: public exception {
108 *   const char *info;
109   public:
110 *   ~bib1Exception ();
111     bib1Exception (int errcode, const char *addinfo);
112     const char *errmsg () const;
113     const char *addinfo () const;
114   };
115
116   class YAZ_EXPORT queryException: public exception {
117 *   const char *q;
118   public:
119 *   ~queryException ();
120     enum {
121      PREFIX = 1,
122      CCL = 2
123     };
124     queryException (int qtype, const char *source);
125     const char *errmsg () const;
126     const char *addinfo () const;
127   };
128 }