1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
// =============================================================== //
// //
// File : NT_validNameParser.h //
// Purpose : //
// //
// Coded by Lothar Richter in November 2002 //
// Institute of Microbiology (Technical University Munich) //
// http://www.arb-home.de/ //
// //
// =============================================================== //
#ifndef NT_VALIDNAMEPARSER_H
#define NT_VALIDNAMEPARSER_H
#ifndef ARB_FORWARD_LIST_H
#include <arb_forward_list.h>
#endif
#ifndef __STRING__
#include <string>
#endif
#ifndef __VECTOR__
#include <vector>
#endif
namespace validNames {
typedef arb_forward_list<std::string> LineSet;
typedef LineSet* LineSetPtr;
typedef std::vector<std::string> TokL;
typedef TokL *TokLPtr;
enum DESCT {
VALGEN, HETGEN, HOMGEN, RENGEN, CORGEN,
VALSPEC, HETSPEC, HOMSPEC, RENSPEC, CORSPEC,
NOTYPE, VAL, HET, HOM, REN, COR
};
class Desco {
private:
DESCT type;
bool isCorrected;
std::string firstgen;
std::string firstspec;
std::string firstsub;
std::string secondgen;
std::string secondspec;
std::string secondsub;
public:
Desco(DESCT type_, bool isCorrected_,
std::string firstgen_, std::string firstspec_, std::string firstsub_,
std::string secondgen_, std::string secondspec_, std::string secondsub_)
: type(type_)
, isCorrected(isCorrected_)
, firstgen(firstgen_)
, firstspec(firstspec_)
, firstsub(firstsub_)
, secondgen(secondgen_)
, secondspec(secondspec_)
, secondsub(secondsub_)
{}
std::string getFirstName();
std::string getSecondName();
DESCT getType() const { return type; }
};
LineSet* readFromFile(const char* infile, LineSet* listOfLines);
TokLPtr tokenize(const std::string& description, TokLPtr tokenLP);
Desco determineType(const std::string& descriptionString);
bool isUpperCase(const std::string& input);
}; // end namespace
#else
#error NT_validNameParser.h included twice
#endif // NT_VALIDNAMEPARSER_H
|