CifFileReadDef.h
Go to the documentation of this file.
//$$FILE$$
//$$VERSION$$
//$$DATE$$
//$$LICENSE$$
/*
PURPOSE: Definitions for selective parsing/reading cif file
*/
#ifndef CIFFILEREADDEF_H
#define CIFFILEREADDEF_H
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
enum type {A, D}; //A-list of accepted categorys/datablocks; D-denied
#define INVALID_NUM_CATS -1
class CifFileReadDef
{
private:
int _numCatsToRead;
int _numReadCats;
void SetNumCatsToRead();
protected:
std::vector<std::string> _datablocklist;
std::vector<std::string> _categorylist;
type _datablocklisttype;
type _categorylisttype;
public:
CifFileReadDef(std::vector<std::string> dblist,std::vector<std::string>clist,type dbtype = A, type ctype = A);
CifFileReadDef(){_numCatsToRead = INVALID_NUM_CATS; _numReadCats = 0;};
~CifFileReadDef(){};
void SetDataBlockList(std::vector<std::string> dblist,type dbtype = A);
void SetCategoryList(std::vector<std::string>clist, type ctype = A);
void SetDataBlockListType(type dbtype = A) { _datablocklisttype=dbtype;};
void SetCategoryListType(type ctype = A){_categorylisttype=ctype;};
int AreAllCatsRead();
void IncreaseNumReadCats();
int Category_OK(const std::string& categoryName);
int Datablock_OK(const std::string& datablockName);
};
#endif
type
type
Definition: CifFileReadDef.h:29
A
@ A
Definition: CifFileReadDef.h:29
D
@ D
Definition: CifFileReadDef.h:29
INVALID_NUM_CATS
#define INVALID_NUM_CATS
Definition: CifFileReadDef.h:31
CifFileReadDef
Private class that represents a CIF parser controller.
Definition: CifFileReadDef.h:39
CifFileReadDef::_categorylist
std::vector< std::string > _categorylist
Definition: CifFileReadDef.h:46
CifFileReadDef::SetCategoryList
void SetCategoryList(std::vector< std::string >clist, type ctype=A)
CifFileReadDef::SetDataBlockListType
void SetDataBlockListType(type dbtype=A)
Definition: CifFileReadDef.h:59
CifFileReadDef::CifFileReadDef
CifFileReadDef(std::vector< std::string > dblist, std::vector< std::string >clist, type dbtype=A, type ctype=A)
CifFileReadDef::SetDataBlockList
void SetDataBlockList(std::vector< std::string > dblist, type dbtype=A)
CifFileReadDef::~CifFileReadDef
~CifFileReadDef()
Definition: CifFileReadDef.h:54
CifFileReadDef::AreAllCatsRead
int AreAllCatsRead()
CifFileReadDef::_datablocklist
std::vector< std::string > _datablocklist
Definition: CifFileReadDef.h:45
CifFileReadDef::CifFileReadDef
CifFileReadDef()
Definition: CifFileReadDef.h:53
CifFileReadDef::SetCategoryListType
void SetCategoryListType(type ctype=A)
Definition: CifFileReadDef.h:60
CifFileReadDef::Category_OK
int Category_OK(const std::string &categoryName)
CifFileReadDef::IncreaseNumReadCats
void IncreaseNumReadCats()
CifFileReadDef::_datablocklisttype
type _datablocklisttype
Definition: CifFileReadDef.h:47
CifFileReadDef::_categorylisttype
type _categorylisttype
Definition: CifFileReadDef.h:48
CifFileReadDef::Datablock_OK
int Datablock_OK(const std::string &datablockName)