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

Last change on this file since 411 was 410, checked in by sjboddie, 25 years ago

added some date formatting

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 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 410 1999-07-21 05:00:00Z sjboddie $
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, comIcon};
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 text_t metaname;
28 int metaindex;
29 pcommand_t parentcommand;
30 int parentindex;
31 text_t parentoptions;
32};
33
34struct decision_t {
35 void clear();
36 decision_t () {clear();}
37
38 dcommand_t command;
39 metadata_t meta;
40};
41
42struct format_t {
43 void clear();
44 format_t () {clear();}
45
46 command_t command;
47 decision_t decision;
48 text_t text;
49 metadata_t meta;
50 format_t *nextptr;
51 format_t *ifptr;
52 format_t *elseptr;
53 format_t *orptr;
54};
55
56
57
58bool parse_formatstring (const text_t &formatstring, format_t *formatlistptr,
59 text_tarray &metadata, bool &getParents);
60
61text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr,
62 const text_t &link, const text_t &icon);
63
64text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr);
65
66
67#endif
Note: See TracBrowser for help on using the repository browser.