source: trunk/gsdl/src/recpt/formattools.h@ 357

Last change on this file since 357 was 354, checked in by rjmcnab, 25 years ago

Added ability to print the result number

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1/**********************************************************************
2 *
3 * formattools.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: formattools.h 354 1999-07-08 20:48:33Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef FORMATTOOLS_H
14#define FORMATTOOLS_H
15
16#include "text_t.h"
17#include "comtypes.h"
18
19enum command_t {comIf, comOr, comMeta, comText, comLink, comEndLink, comNum};
20enum pcommand_t {pNone, pImmediate, pTop, pIndex, pAll};
21enum dcommand_t {dMeta};
22
23struct metadata_t {
24 void clear();
25 metadata_t () {clear();}
26
27 int metaindex;
28 pcommand_t parentcommand;
29 int parentindex;
30 text_t parentoptions;
31};
32
33struct decision_t {
34 void clear();
35 decision_t () {clear();}
36
37 dcommand_t command;
38 metadata_t meta;
39};
40
41struct format_t {
42 void clear();
43 format_t () {clear();}
44
45 command_t command;
46 decision_t decision;
47 text_t text;
48 metadata_t meta;
49 format_t *nextptr;
50 format_t *ifptr;
51 format_t *elseptr;
52 format_t *orptr;
53};
54
55
56
57bool parse_formatstring (const text_t &formatstring, format_t *formatlistptr,
58 text_tarray &metadata, bool &getParents);
59
60text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr);
61
62
63#endif
Note: See TracBrowser for help on using the repository browser.