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 211 1999-03-25 03:13:42Z sjboddie $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 |
|
---|
13 | #ifndef OIDTOOLS_H
|
---|
14 | #define OIDTOOLS_H
|
---|
15 |
|
---|
16 | #include "text_t.h"
|
---|
17 |
|
---|
18 | // get first four characters of whatever string is passed in
|
---|
19 | // OID. This returns the CLSU, HASH etc.
|
---|
20 | void get_head (const text_t &OID, text_t &head);
|
---|
21 |
|
---|
22 | // returns (in top) the top level of OID (i.e. everything
|
---|
23 | // up until the first dot)
|
---|
24 | void get_top (const text_t &OID, text_t &top);
|
---|
25 |
|
---|
26 | // checks if OID is top level (i.e. contains no dots)
|
---|
27 | bool is_top (const text_t &OID);
|
---|
28 |
|
---|
29 | // is_classification checks OID to see if it's a classification
|
---|
30 | // or a document. I'm not sure how to do this - for now I'll just assume
|
---|
31 | // all documents start with HASH and classifications start with something
|
---|
32 | // else.
|
---|
33 | bool is_classification (const text_t &OID);
|
---|
34 |
|
---|
35 | // don't know how to do this yet either ...
|
---|
36 | bool contains_text (const text_t &OID);
|
---|
37 |
|
---|
38 | // get_parents_array loads the parents array with all the parents of the
|
---|
39 | // document or classification specified by OID
|
---|
40 | // note that this function doesn't clear the parents array
|
---|
41 | void get_parents_array (const text_t &OID, text_tarray &parents);
|
---|
42 |
|
---|
43 | // get_children loads the children array with all the children of the
|
---|
44 | // document or classification specified by targetdoc
|
---|
45 | void get_children_array (const text_t &OID, text_tarray &children);
|
---|
46 |
|
---|
47 | // get_parent returns the parent of the document or classification
|
---|
48 | // specified by OID
|
---|
49 | text_t get_parent (text_t OID);
|
---|
50 |
|
---|
51 | // get_first_child loads child with the first
|
---|
52 | // child of OID
|
---|
53 | void get_first_child(const text_t &OID, text_t &child);
|
---|
54 |
|
---|
55 |
|
---|
56 | #endif
|
---|