#ifndef Z3950SERVER_H #define Z3050SERVER_H #include "comtypes.h" // each "server" (ie collection) consists of a {z39.50 server + database} pair. class z3950_server { protected: text_t title; // Descriptive name text_t z_initstr; // a string returned when the connection is initialised. text_tmap meta; // metadata for this collection (ie server/database pair) text_tmap about; // langauge/abouttext pair for collection. ShortColInfo_t *info; // has (database) name, host and port text_tarray *titles; bool connect(); bool connected; // tcp connection to the z39.50 server (target) public: z3950_server(); ~z3950_server(); void setName(const text_t &newname); const text_t getName() {return title;} void setMeta(const text_t &key, const text_t &value); const text_tmap *getMeta() {return &meta;} void setInfo(ShortColInfo_t *newinfo) {info=newinfo;} const ShortColInfo_t *getInfo() {return info;} void addcfgAbout(const text_t &lang, const text_t &abouttext); bool getcfgAbout(const text_t &lang, text_t &abouttext); // now the functions that actually talk to the target (ie zserver) over tcp text_t &getzAbout(); // gets any name, id, MOTD, etc from server. text_tarray *getbriefrecords(const text_t &query, const int first, const int count, int *nummatches, comerror_t &err); /* only get one record at a time? (Eventually we could buffer them, but for now... */ bool getfullrecord(const int ID, text_t &rettitle, text_t &rettext,comerror_t &err); }; typedef vector z3950_server_array; #endif