CifFileReadDef.h

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

Generated on Tue Apr 24 09:25:37 2007 for cifparse-obj-v7.0 by  doxygen 1.5.1