#ifndef ENVIHEADER_H #define ENVIHEADER_H #include #include #include #include #include using namespace std; enum InterleaveType {bip, bil, bsq}; class EnviHeaderClass //"EnviheaderClass" will be used to store data into variables sX, sY, etc. { public: unsigned int sX; //samples = "sX" unsigned int sY; //lines = "sY" unsigned int nF; //bands = "nF" unsigned int headersize; //header offset = "headersize" unsigned int datatype; //data type = "datatype" InterleaveType type; string units; //wavelength units = "units" (Usully in Wavenumber or Wavelength) int LoadHeader(string filename) { ifstream inFile; //Load the header file in the same directory, for future note, might want to modify code to either "cin" the file name of have a feature in the GUI which take into account different fileneames inFile.open (filename.c_str()); //If or not there is a file if (!inFile) { cout<<"Error"<>result; //converts result from previous line return result; } //retrieves a string parameter from a line of text string getString(string line) { int position; position=line.find("="); //Finds the position of the equal sign string word; //Creates a string for storing word data called "word" word=line.substr(position+2); //Moves from the position of "=" 2 spaces to the right //Note: We do not need to convert word using "istringstream" return word; } }; #endif