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

Last change on this file since 1285 was 1285, checked in by sjboddie, 24 years ago

Removed CVS logging information from source files

  • 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 *********************************************************************/
25
26
27#ifndef OIDTOOLS_H
28#define OIDTOOLS_H
29
30#include "text_t.h"
31#include "recptproto.h"
32
33// returns (in top) the top level of OID (i.e. everything
34// up until the first dot)
35void get_top (const text_t &OID, text_t &top);
36
37// checks if OID is top level (i.e. contains no dots)
38bool is_top (const text_t &OID);
39
40// get_parents_array loads the parents array with all the parents of the
41// document or classification specified by OID (not including OID itself)
42void get_parents_array (const text_t &OID, text_tarray &parents);
43
44// get_info does a protocol call and returns (in response) the info
45// associated with OID. Metadata should be loaded with whatever
46// metadata fields are to be requested
47bool get_info (const text_t &OID, const text_t &collection,
48 const text_tset &metadata, bool getParents,
49 recptproto *collectproto, FilterResponse_t &response,
50 ostream &logout);
51bool get_info (const text_tarray &OIDs, const text_t &collection,
52 const text_tset &metadata, bool getParents,
53 recptproto *collectproto, FilterResponse_t &response,
54 ostream &logout);
55
56// has_children returns true if OID has children
57bool has_children (const text_t &OID, const text_t &collection,
58 recptproto *collectproto, ostream &logout);
59
60// get_children does a protocol call and returns (in response) the OIDs and
61// metadata of all the children of OID. The metadata set should be loaded
62// with whatever metadata fields are to be requested.
63bool get_children (const text_t &OID, const text_t &collection,
64 const text_tset &metadata, bool getParents,
65 recptproto *collectproto, FilterResponse_t &response,
66 ostream &logout);
67
68// get_parent returns the parent of the document or classification
69// specified by OID
70text_t get_parent (text_t OID);
71
72// takes an OID like ".2.3 and replaces the " with parent
73void translate_parent (text_t &OID, const text_t &parent);
74
75// shrink_parent does the opposite to translate_parent
76void shrink_parent (text_t &OID);
77
78// checks if OID uses ".fc", ".lc", ".pr", ".ns",
79// or ".ps" syntax (first child, last child, parent,
80// next sibling, previous sibling)
81bool needs_translating (const text_t &OID);
82
83// strips the ".fc", ".lc", ".pr", ".ns",
84// or ".ps" suffix from the end of OID
85void strip_suffix (text_t &OID);
86
87// get_contents returns OIDs and metadata of all contents
88// below (and including) OID.
89void get_contents (const text_t &topOID, const bool &is_classify,
90 text_tset &metadata, const text_t &collection,
91 recptproto *collectproto, FilterResponse_t &response,
92 ostream &logout);
93
94// is_child_of returns true if OID2 is a child of OID1
95bool is_child_of(const text_t &OID1, const text_t &OID2);
96
97
98#endif
Note: See TracBrowser for help on using the repository browser.