source: tags/cvs_2_svn/NTREE/nt_validNameParser.hxx

Last change on this file was 3261, checked in by westram, 20 years ago
  • includes list, string, vector
  • uses std::
  • fixed ctor
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/**
2 * Declaration of all objects belonging to this version of
3 * the valid names text file
4 *
5 * 29. November 2002
6 *
7 * copyright by Lothar Richter
8 */
9
10#ifndef NT_VALID_NAMEPARSER
11#define NT_VALID_NAMEPARSER
12
13#ifndef __LIST__
14#include <list>
15#endif
16#ifndef __STRING__
17#include <string>
18#endif
19#ifndef __VECTOR__
20#include <vector>
21#endif
22
23namespace validNames {
24
25    typedef std::list<std::string> LineSet;
26    typedef LineSet* LineSetPtr;
27
28    typedef std::vector<std::string> TokL;
29    typedef TokL *TokLPtr;
30
31    typedef enum {
32        VALGEN, HETGEN, HOMGEN, RENGEN, CORGEN,
33        VALSPEC, HETSPEC, HOMSPEC, RENSPEC, CORSPEC,
34        NOTYPE, VAL, HET, HOM, REN, COR
35    } DESCT;
36
37    class Desco {
38    private:
39        DESCT type;
40        bool isCorrected;
41        std::string firstgen;
42        std::string firstspec;
43        std::string firstsub;
44        std::string secondgen;
45        std::string secondspec;
46        std::string secondsub;
47
48    public:
49        Desco(DESCT       type_ , bool isCorrected_,
50              std::string firstgen_, std::string firstspec_, std::string firstsub_,
51              std::string secondgen_, std::string secondspec_, std::string secondsub_)
52            : type(type_) , isCorrected(isCorrected_)
53            , firstgen(firstgen_) , firstspec(firstspec_) , firstsub(firstsub_)
54            , secondgen(secondgen_) , secondspec(secondspec_) , secondsub(secondsub_)
55        { }
56
57        std::string getFirstName();
58        std::string getSecondName();
59        DESCT getType() const { return type; }
60    };
61
62
63
64
65    LineSet* readFromFile(const char* infile, LineSet* listOfLines);
66
67    TokLPtr tokenize(const std::string& description, TokLPtr tokenLP);
68
69    Desco determineType(const std::string& descriptionString);
70
71    bool isUpperCase(const std::string& input);
72}; /* end namespace */
73
74#endif
75
Note: See TracBrowser for help on using the repository browser.