source: trunk/gsdl/src/recpt/OIDtools.h@ 248

Last change on this file since 248 was 248, checked in by sjboddie, 25 years ago

lots of stuff - getting documentaction working (documentaction replaces
old browseaction)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/**********************************************************************
2 *
3 * OIDtools.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: OIDtools.h 248 1999-04-30 01:59:44Z sjboddie $
9 *
10 *********************************************************************/
11
12
13#ifndef OIDTOOLS_H
14#define OIDTOOLS_H
15
16#include "text_t.h"
17#include "recptproto.h"
18
19// get first four characters of whatever string is passed in
20// OID. This returns the CLSU, HASH etc.
21void get_head (const text_t &OID, text_t &head);
22
23// returns (in top) the top level of OID (i.e. everything
24// up until the first dot)
25void get_top (const text_t &OID, text_t &top);
26
27// checks if OID is top level (i.e. contains no dots)
28bool is_top (const text_t &OID);
29
30// is_classification checks OID to see if it's a classification
31// or a document. I'm not sure how to do this - for now I'll just assume
32// all documents start with HASH and classifications start with something
33// else.
34bool is_classification (const text_t &OID);
35
36// get_parents_array loads the parents array with all the parents of the
37// document or classification specified by OID
38// note that this function doesn't clear the parents array
39void get_parents_array (const text_t &OID, text_tarray &parents);
40
41// get_info does a protocol call and returns (in response) the info
42// associated with OID. The metadata array should be loaded with whatever
43// metadata fields are to be requested
44bool get_info (const text_t &OID, const text_t &collection,
45 const text_tarray &metadata, recptproto *collectproto,
46 FilterResponse_t &response, ostream &logout);
47
48// get_children does a protocol call and returns (in response) the OIDs and
49// metadata of all the children of OID. The metadata array should be loaded
50// with whatever metadata fields are to be requested.
51bool get_children (const text_t &OID, const text_t &collection,
52 const text_tarray &metadata, recptproto *collectproto,
53 FilterResponse_t &response, ostream &logout);
54
55// get_first_child does a protocol call and returns (in child) the OID
56// of the first child of OID if it exists
57bool get_first_child (const text_t &OID, text_t &child, const text_t &collection,
58 recptproto *collectproto, ostream logout);
59
60// get_parent returns the parent of the document or classification
61// specified by OID
62text_t get_parent (text_t OID);
63
64// takes an OID like ".2.3 and replaces the " with parent
65void translate_parent (text_t &OID, const text_t &parent);
66
67// shrink_parent does the opposite to translate_parent
68void shrink_parent (text_t &OID);
69
70// checks if OID uses ".fc", ".lc", ".pr", ".ns",
71// or ".ps" syntax (first child, last child, parent,
72// next sibling, previous sibling)
73bool needs_translating (const text_t &OID);
74
75#endif
Note: See TracBrowser for help on using the repository browser.