/********************************************************************** * * OIDtools.h -- * Copyright (C) 1999 The New Zealand Digital Library Project * * PUT COPYRIGHT NOTICE HERE * * $Id: OIDtools.h 346 1999-07-07 05:47:41Z sjboddie $ * *********************************************************************/ #ifndef OIDTOOLS_H #define OIDTOOLS_H #include "text_t.h" #include "recptproto.h" // returns (in top) the top level of OID (i.e. everything // up until the first dot) void get_top (const text_t &OID, text_t &top); // checks if OID is top level (i.e. contains no dots) bool is_top (const text_t &OID); // get_parents_array loads the parents array with all the parents of the // document or classification specified by OID (not including OID itself) void get_parents_array (const text_t &OID, text_tarray &parents); // get_info does a protocol call and returns (in response) the info // associated with OID. The metadata array should be loaded with whatever // metadata fields are to be requested bool get_info (const text_t &OID, const text_t &collection, const text_tarray &metadata, bool getParents, recptproto *collectproto, FilterResponse_t &response, ostream &logout); // has_children returns true if OID has children bool has_children (const text_t &OID, const text_t &collection, recptproto *collectproto, ostream &logout); // get_children does a protocol call and returns (in response) the OIDs and // metadata of all the children of OID. The metadata array should be loaded // with whatever metadata fields are to be requested. bool get_children (const text_t &OID, const text_t &collection, const text_tarray &metadata, recptproto *collectproto, FilterResponse_t &response, ostream &logout); // get_parent returns the parent of the document or classification // specified by OID text_t get_parent (text_t OID); // takes an OID like ".2.3 and replaces the " with parent void translate_parent (text_t &OID, const text_t &parent); // shrink_parent does the opposite to translate_parent void shrink_parent (text_t &OID); // checks if OID uses ".fc", ".lc", ".pr", ".ns", // or ".ps" syntax (first child, last child, parent, // next sibling, previous sibling) bool needs_translating (const text_t &OID); // strips the ".fc", ".lc", ".pr", ".ns", // or ".ps" suffix from the end of OID void strip_suffix (text_t &OID); // get_contents returns OIDs and metadata of all contents // below (and including) OID. // at present the only metadata being returned for each is // Title and haschildren void get_contents (const text_t &topOID, const text_t &classifytype, int &totalcols, const text_t &collection, recptproto *collectproto, FilterResponse_t &response, ostream &logout); // is_child_of returns true if OID2 is a child of OID1 bool is_child_of(const text_t &OID1, const text_t &OID2); #endif