X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/493266210f4f7627378161978968e719372ef03e..061e6469f58f3e3e892f1cd1f6fdd2aad9c644e8:/datread.h?ds=sidebyside diff --git a/datread.h b/datread.h new file mode 100644 index 0000000..8ef4b15 --- /dev/null +++ b/datread.h @@ -0,0 +1,39 @@ +#ifndef DATREAD_H +#define DATREAD_H + +#include +#include + +#include +#include + +using namespace std; + +class datread { + public: + datread (const unsigned int& _blocksize, ostream *_log=NULL); + ~datread (); + int openFile (const string& filename); + enum class Format {DAT, EDAT, SDAT}; + void * getHeader (const string& headerid); + int readFullBlock (char *tmpData); + bool fisopen (); + string getParaString (); + void closeFile (); + private: + const unsigned int blocksize; + ifstream infile; + Format format; + string parastring; + boost::iostreams::filtering_istreambuf *inbuffer; + ostream * const log; + int readDataToMem (char *tmpData, long unsigned int dataSize); + string filename; + int readHeader (); + vector< pair > headerStore; + void deleteHeaderStore (); + bool readAllHeaders (); + static unsigned long hash(const string& str); +}; + +#endif