/usr/include/yazpp/zoom.h is in libyazpp4-dev 1.4.1-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | // ZOOM C++ Binding.
// The ZOOM homepage is at http://zoom.z3950.org/
//
// Derived from version 1.3a at
// http://zoom.z3950.org/bind/cplusplus/zoom-1.3a.hh
#include <stddef.h> // for size_t
#include <string>
/*
* This is a bit stupid. The fact that our ZOOM-C++ implementation is
* based on the ZOOM-C implementation is our Dirty Little Secret, and
* there is in principle no reason why client code need be bothered
* with it. Except of course that the public class declarations in
* C++ have to lay their private parts out for the world to see
* (oo-er). Hence the inclusion of <yaz/zoom.h>
*/
#include <yaz/zoom.h>
namespace ZOOM {
// Forward declarations for type names.
class YAZ_EXPORT query;
class YAZ_EXPORT resultSet;
class YAZ_EXPORT record;
class YAZ_EXPORT connection {
ZOOM_connection c;
friend class resultSet; // so it can use _getYazConnection()
ZOOM_connection _getYazConnection () const { return c; }
// connections are non-copyable.
connection (const connection &);
connection &operator= (const connection &);
public:
connection ();
connection (const std::string &hostname, int portnum);
~connection ();
void connect (const std::string &hostname, int portnum);
std::string option (const std::string &key) const;
bool option (const std::string &key, const std::string &val);
};
class query {
// base class for all query types
friend class resultSet; // so it can use _getYazQuery()
ZOOM_query _getYazQuery () const { return q; }
protected:
ZOOM_query q;
public:
query ();
virtual ~query ();
};
class YAZ_EXPORT prefixQuery : public query {
public:
prefixQuery (const std::string &pqn);
~prefixQuery ();
};
class YAZ_EXPORT CCLQuery : public query {
public:
CCLQuery (const std::string &ccl, void *qualset);
~CCLQuery ();
};
class YAZ_EXPORT resultSet {
connection &owner;
ZOOM_resultset rs;
friend class record; // for _getYazResultSet() & _getYazConnection()
ZOOM_resultset _getYazResultSet () const { return rs; }
ZOOM_connection _getYazConnection () const {
return owner._getYazConnection(); }
// resultSets are non-copyable.
resultSet (const resultSet &);
resultSet &operator= (const resultSet &);
public:
resultSet (connection &c, const query &q);
~resultSet ();
std::string option (const std::string &key) const;
bool option (const std::string &key, const std::string &val);
size_t size () const;
};
class YAZ_EXPORT record {
const resultSet &owner;
ZOOM_record r;
public:
class YAZ_EXPORT syntax {
public:
enum value {
UNKNOWN, GRS1, SUTRS, USMARC, UKMARC, XML
};
private:
enum value val;
public:
syntax (value rs);
operator std::string () const;
bool operator== (const syntax &s) const;
bool operator== (value rs) const;
operator value () const;
};
record (resultSet &rs, size_t num);
~record ();
syntax recsyn () const;
std::string render () const;
std::string rawdata () const;
};
// Base exception class; from which all other ZOOM exceptions
// are derived. Other classes that use this as their base
// class may want to provide their own errcode() and errmsg()
// functions -- hence they are made virtual.
class YAZ_EXPORT exception {
protected:
int code;
public:
exception (int code);
virtual ~exception ();
virtual int errcode () const;
virtual std::string errmsg () const;
};
// systemException could be thrown for timeouts, protocol errors,
// network outages.
class YAZ_EXPORT systemException : public exception {
public:
systemException (); // Uses value of system `errno'
systemException (int code);
virtual std::string errmsg () const; // Why do I have to repeat this?
};
// bib1Exception::errcode() returns a code from the
// Bib-1 Diagnostic Set.
class YAZ_EXPORT bib1Exception: public exception {
std::string info;
public:
~bib1Exception ();
bib1Exception (int code, const std::string &addinfo);
virtual std::string errmsg () const; // Why do I have to repeat this?
std::string addinfo () const;
};
class YAZ_EXPORT queryException : public exception {
std::string q;
public:
~queryException ();
enum { PREFIX, CCL };
queryException (int qtype, const std::string &source);
virtual std::string errmsg () const; // Why do I have to repeat this?
std::string addinfo () const;
};
}
|