Remove vacuous redeclarations and redefinitions of the errcode()
[yazpp-moved-to-github.git] / zoom / master-header
1 // $Id: master-header,v 1.9 2002-11-12 22:43:56 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   int errcode ();
30   char *errmsg ();
31   char *addinfo ();
32
33   class YAZ_EXPORT connection {
34 *   ZOOM_connection c;
35 *   friend class resultSet; // so it can use _getYazConnection()
36 *   ZOOM_connection _getYazConnection () const { return c; }
37   public:
38     connection (const char *hostname, int portnum);
39     ~connection ();
40     const char *option (const char *key) const;
41     const char *option (const char *key, const char *val);
42   };
43
44   class query {
45       // pure virtual class: derive concrete subclasses from it.
46 *   friend class resultSet; // so it can use _getYazQuery()
47 *   ZOOM_query _getYazQuery () const { return q; }
48 * protected:
49 *   ZOOM_query q;
50   public:
51     virtual ~query ();
52   };
53
54   class YAZ_EXPORT prefixQuery : public query {
55   public:
56     prefixQuery (const char *pqn);
57     ~prefixQuery ();
58   };
59
60   class YAZ_EXPORT CCLQuery : public query {
61   public:
62     CCLQuery (const char *ccl, void *qualset);
63     ~CCLQuery ();
64   };
65
66   class YAZ_EXPORT resultSet {
67 *   connection &owner;
68 *   ZOOM_resultset rs;
69   public:
70     resultSet (connection &c, const query &q);
71     ~resultSet ();
72     const char *option (const char *key) const;
73     const char *option (const char *key, const char *val);
74     size_t size () const;
75     const record *getRecord (size_t i) const;
76   };
77
78   class YAZ_EXPORT record {
79 *   const resultSet *owner;
80 *   ZOOM_record r;
81 *   friend class resultSet; // so it can use this constructor
82 *   record::record (const resultSet *rs, ZOOM_record rec):
83 *       owner (rs), r (rec) {}
84   public:
85     ~record ();
86     enum syntax {
87       UNKNOWN, GRS1, SUTRS, USMARC, UKMARC, XML
88     };
89     record *clone () const;
90     syntax recsyn () const;
91     const char *render () const;
92     const char *rawdata () const;
93   };
94
95   class YAZ_EXPORT exception {
96 * protected:
97 *   int code;
98   public:
99     exception (int code);
100     int errcode () const;
101     const char *errmsg () const;
102   };
103
104   class YAZ_EXPORT systemException: public exception {
105   public:
106     systemException ();
107     const char *errmsg () const;
108   };
109
110   class YAZ_EXPORT bib1Exception: public exception {
111 *   const char *info;
112   public:
113 *   ~bib1Exception ();
114     bib1Exception (int errcode, const char *addinfo);
115     const char *errmsg () const;
116     const char *addinfo () const;
117   };
118
119   class YAZ_EXPORT queryException: public exception {
120 *   const char *q;
121   public:
122 *   ~queryException ();
123     enum {
124      PREFIX = 1,
125      CCL = 2
126     };
127     queryException (int qtype, const char *source);
128     const char *errmsg () const;
129     const char *addinfo () const;
130   };
131 }