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

Last change on this file since 649 was 649, checked in by sjboddie, 25 years ago
  • metadata now returns mp rather than array
  • redesigned browsing support (although it's not finished so

won't currently work ;-)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/**********************************************************************
2 *
3 * OIDtools.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * $Id: OIDtools.h 649 1999-10-10 08:14:12Z sjboddie $
25 *
26 *********************************************************************/
27
28
29#ifndef OIDTOOLS_H
30#define OIDTOOLS_H
31
32#include "text_t.h"
33#include "recptproto.h"
34
35// returns (in top) the top level of OID (i.e. everything
36// up until the first dot)
37void get_top (const text_t &OID, text_t &top);
38
39// checks if OID is top level (i.e. contains no dots)
40bool is_top (const text_t &OID);
41
42// get_parents_array loads the parents array with all the parents of the
43// document or classification specified by OID (not including OID itself)
44void get_parents_array (const text_t &OID, text_tarray &parents);
45
46// get_info does a protocol call and returns (in response) the info
47// associated with OID. Metadata should be loaded with whatever
48// metadata fields are to be requested
49bool get_info (const text_t &OID, const text_t &collection,
50 const text_tset &metadata, bool getParents,
51 recptproto *collectproto, FilterResponse_t &response,
52 ostream &logout);
53bool get_info (const text_tarray &OIDs, const text_t &collection,
54 const text_tset &metadata, bool getParents,
55 recptproto *collectproto, FilterResponse_t &response,
56 ostream &logout);
57
58// has_children returns true if OID has children
59bool has_children (const text_t &OID, const text_t &collection,
60 recptproto *collectproto, ostream &logout);
61
62// get_children does a protocol call and returns (in response) the OIDs and
63// metadata of all the children of OID. The metadata set should be loaded
64// with whatever metadata fields are to be requested.
65bool get_children (const text_t &OID, const text_t &collection,
66 const text_tset &metadata, bool getParents,
67 recptproto *collectproto, FilterResponse_t &response,
68 ostream &logout);
69
70// get_parent returns the parent of the document or classification
71// specified by OID
72text_t get_parent (text_t OID);
73
74// takes an OID like ".2.3 and replaces the " with parent
75void translate_parent (text_t &OID, const text_t &parent);
76
77// shrink_parent does the opposite to translate_parent
78void shrink_parent (text_t &OID);
79
80// checks if OID uses ".fc", ".lc", ".pr", ".ns",
81// or ".ps" syntax (first child, last child, parent,
82// next sibling, previous sibling)
83bool needs_translating (const text_t &OID);
84
85// strips the ".fc", ".lc", ".pr", ".ns",
86// or ".ps" suffix from the end of OID
87void strip_suffix (text_t &OID);
88
89// get_contents returns OIDs and metadata of all contents
90// below (and including) OID.
91void get_contents (const text_t &topOID, const bool &is_classify,
92 text_tset &metadata, const text_t &collection,
93 recptproto *collectproto, FilterResponse_t &response,
94 ostream &logout);
95
96// is_child_of returns true if OID2 is a child of OID1
97bool is_child_of(const text_t &OID1, const text_t &OID2);
98
99
100#endif
Note: See TracBrowser for help on using the repository browser.