1 // $XConsortium: uasdrv.cc /main/4 1996/06/11 16:45:11 cde-hal $
6 # include "Exceptions.hh"
11 printTitles (UAS_Pointer<UAS_Common> doc, int level) {
13 for (i = 0; i < level; i ++)
14 fprintf (stderr, " ");
15 fprintf (stderr, "%s\n", (char *) doc->title ());
16 UAS_Pointer<UAS_Common> curDoc;
17 if (doc->type() == UAS_BOOK) {
20 fprintf (stderr, "********** %s \n", (char *) curDoc->title ());
21 curDoc = curDoc->next();
24 UAS_List<UAS_Common> theList = doc->children ();
25 for (i = 0; i < theList.length(); i ++)
26 printTitles (theList[i], level + 1);
33 printLocs (UAS_Pointer<UAS_Common> doc, int level) {
34 for (int i = 0; i < level; i ++)
36 UAS_String theLoc = doc->locator();
39 UAS_String loc = doc->id();
40 (void) sprintf (buf, "mmdb:LOCATOR=%s", (char *) loc);
41 UAS_Pointer<UAS_Common> theDoc = UAS_Common::create(buf);
42 cerr << (char *) theLoc << ", " << (char *) theDoc->title() << endl;
44 cerr << (char *) theLoc << endl;
46 UAS_List<UAS_Common> kids = doc->children();
47 for (i = 0; i < kids.length(); i ++) {
48 printLocs (kids[i], level + 1);
52 int main (int, char *[]) {
54 UAS_Common::initialize ();
55 UAS_List<UAS_String> locList = UAS_Common::rootLocators ();
56 for (int i = 0; i < locList.length(); i ++) {
57 UAS_String &cur = locList[i];
58 UAS_Pointer<UAS_Common> curDoc = UAS_Common::create(cur);
59 UAS_Pointer<UAS_Collection> curCol = (UAS_Collection *)
60 ((UAS_Common *) curDoc);
61 printLocs (curCol->root(), 0);
62 curDoc = curCol->root();
64 UAS_Common::destroy (curDoc);
66 UAS_Common::finalize ();