/* * ConfigFileBuffer.hpp * * Created on: 12.06.2010 * Author: heber */ #ifndef CONFIGFILEBUFFER_HPP_ #define CONFIGFILEBUFFER_HPP_ /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include /****************************************** forward declarations *****************************/ /********************************************** declarations *******************************/ class ConfigFileBuffer { public: char **buffer; int *LineMapping; int CurrentLine; int NoLines; ConfigFileBuffer(); ConfigFileBuffer(const char * const filename); ~ConfigFileBuffer(); void InitFileBuffer(const char * const filename); void InitFileBuffer(std::istream *file); void MapIonTypesInBuffer(const int NoAtoms); private: /* * Whether LineMapping is allocated or not. */ bool MappingAllocated; void InitMapping(); void RemoveMapping(); void RemoveBuffer(); }; #endif /* CONFIGFILEBUFFER_HPP_ */