source: trunk/gsdl/src/recpt/z3950server.h@ 1347

Last change on this file since 1347 was 1347, checked in by jrm21, 24 years ago

merged z39.50 receptionist stuff into main trunk (along with the mgpp stuff)

  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#ifndef Z3950SERVER_H
2#define Z3050SERVER_H
3
4#include "comtypes.h"
5
6// each "server" (ie collection) consists of a {z39.50 server + database} pair.
7class z3950_server {
8 protected:
9 text_t title; // Descriptive name
10 text_t z_initstr; // a string returned when the connection is initialised.
11 text_tmap meta; // metadata for this collection (ie server/database pair)
12 text_tmap format;
13 text_tmap about; // langauge/abouttext pair for collection.
14 ShortColInfo_t *info; // has (database) name, host and port
15 text_tarray *titles;
16 bool connect();
17 bool connected; // tcp connection to the z39.50 server (target)
18
19 public:
20 z3950_server();
21 ~z3950_server();
22 void setName(const text_t &newname);
23 const text_t getName() {return title;}
24 void setMeta(const text_t &key, const text_t &value);
25 const text_tmap *getMeta() {return &meta;}
26 const text_tmap *getFormat() {return &format;}
27 void setInfo(ShortColInfo_t *newinfo) {info=newinfo;}
28 const ShortColInfo_t *getInfo() {return info;}
29 void addcfgAbout(const text_t &lang, const text_t &abouttext);
30 bool getcfgAbout(const text_t &lang, text_t &abouttext);
31 // now the functions that actually talk to the target (ie zserver) over tcp
32 text_t &getzAbout(); // gets any name, id, MOTD, etc from server.
33 text_tarray *getrecordTitles(const text_t &query,
34 const text_t &fields,
35 const int first, const int count,
36 int *nummatches, comerror_t &err);
37 /* only get one record at a time? (Eventually we could buffer them, but
38 for now... */
39 bool getfullrecord(const text_t &query, const text_t &fields,
40 const int ID, text_t &rettitle,
41 text_t &rettext,comerror_t &err);
42 private:
43 void parseQuery(const text_t &query, const text_t &fields,
44 text_t &parsed_query);
45};
46
47typedef vector<z3950_server *> z3950_server_array;
48
49#endif
Note: See TracBrowser for help on using the repository browser.