gbfn.h

Go to the documentation of this file.
00001 //file: gbfn.h
00002 #ifndef GBFN_H
00003 #define GBFN_H
00004 #include <iostream>
00005 #include <string>
00006 #include <vector>
00007 #include <map>
00008 //#include <assert.h>
00009 
00010 using namespace std;
00011 
00012 #ifndef LINE
00013 #define LINE 84  
00014 #endif
00015 
00016 const int FIELD_START = 12;
00017 //const int QUALIFIER_START = 21;
00018 //const int FEATURE_KEY = 5;
00019 
00020 //line length in record
00021 //common functions used for processing GB flat file
00022 //file: gbfn.h
00023 
00024 /* Before the call, ln should contain the first line of the record. 
00025  * f will be dynamically allocated and resized with new.  The caller
00026  * has to deallocate the memory after the call.
00027  * After the call, ln will contain the line following this record 
00028  * Simply read everything on the lines, no postprpcessing is done.
00029  * */
00030 void getField(char *&f, istream &ins, char ln[]);
00031 //another version of getField, using string
00032 void getf(string &ff, istream &ins, string &ln);
00033 // performance low
00034 string getf(istream &ins, string &ln);
00035 
00036 // this one moved into pfeature.h file
00037 //pair<string, string> getQualifier(istream &ins, string &ln);
00038 
00039 class gbdate {
00040         public:
00041                 void parseGB(const string &str);
00042                 void writeAce(ostream &ous);
00043 
00044                 static string parseGBDate(const string &str);
00045                 static map<string, string> monthMap;
00046                 static void setup();
00047 
00048         private:
00049                 char day[3];
00050                 char month[4];
00051                 char year[5];
00052 };
00053 
00054 #endif
00055 

Generated on Wed Aug 10 11:56:58 2011 for Softwares from Orpara by  doxygen 1.5.6