source: trunk/gsdl/src/colservr/maptools.h@ 367

Last change on this file since 367 was 194, checked in by rjmcnab, 25 years ago

Moved from src/recpt.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1/**********************************************************************
2 *
3 * maptools.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: maptools.h 194 1999-03-09 20:53:14Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef MAPTOOLS_H
14#define MAPTOOLS_H
15
16
17#include "gsdlconf.h"
18#include "text_t.h"
19
20// stringmap is a mapping which remembers the original order
21// of the map, but is very fast to look up.
22class stringmap {
23protected:
24 text_tarray fromorder;
25 text_tmap mapfrom;
26
27public:
28 void clear ();
29
30 void importmap (const text_tarray &maparray);
31 void exportmap (text_tarray &maparray) const;
32
33 void getfromarray (text_tarray &fromarray) const;
34 void gettoarray (text_tarray &toarray) const;
35
36 bool fromexists (const text_t &from) const;
37 bool toexists (const text_t &to) const;
38
39 // from2to and to2from return false if the key (the "from"
40 // field or the "to" field) cannot be found
41 bool from2to (const text_t &from, text_t &to) const;
42 bool to2from (const text_t &to, text_t &from) const;
43};
44
45
46// a few useful functions used by stringmap
47void splitmapentry (const text_t &map, text_t &from, text_t &to);
48void joinmapentry (const text_t &from, const text_t &to, text_t &map);
49
50
51#endif
Note: See TracBrowser for help on using the repository browser.