00001 //$$FILE$$ 00002 //$$VERSION$$ 00003 //$$DATE$$ 00004 //$$LICENSE$$ 00005 /* 00006 PURPOSE: Definitions for selective parsing/reading cif file 00007 */ 00008 00009 #ifndef CIFFILEREADDEF_H 00010 #define CIFFILEREADDEF_H 00011 00012 #include <string> 00013 #include <vector> 00014 00015 using namespace std; 00016 00017 #include <iostream> 00018 #include <fstream> 00019 #include <stdio.h> 00020 #include <string.h> 00021 #include "ndb_misclib.h" 00022 00023 enum type {A, D}; //A-list of accepted categorys/datablocks; D-denied 00024 00025 #define INVALID_NUM_CATS -1 00026 00027 class CifFileReadDef { 00028 private: 00029 int _numCatsToRead; 00030 int _numReadCats; 00031 void SetNumCatsToRead(); 00032 protected: 00033 vector<string> _datablocklist; 00034 vector<string> _categorylist; 00035 type _datablocklisttype; 00036 type _categorylisttype; 00037 00038 00039 public: 00040 CifFileReadDef(vector<string> dblist,vector<string>clist,type dbtype = A, type ctype = A); 00041 CifFileReadDef(){_numCatsToRead = INVALID_NUM_CATS; _numReadCats = 0;}; 00042 ~CifFileReadDef(){}; 00043 00044 void SetDataBlockList(vector<string> dblist,type dbtype = A); 00045 void SetCategoryList(vector<string>clist, type ctype = A); 00046 00047 void SetDataBlockListType(type dbtype = A) { _datablocklisttype=dbtype;}; 00048 void SetCategoryListType(type ctype = A){_categorylisttype=ctype;}; 00049 00050 int AreAllCatsRead(); 00051 void IncreaseNumReadCats(); 00052 00053 int Category_OK(const string& categoryName); 00054 int Datablock_OK(const string& datablockName); 00055 }; 00056 #endif