00001 /* 00002 * Copyright (C) 2010 Regents of the University of Michigan 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef __GLF_HEADER_H__ 00019 #define __GLF_HEADER_H__ 00020 00021 #include <stdint.h> 00022 00023 #include "InputFile.h" 00024 #include "CharBuffer.h" 00025 00026 class GlfHeader 00027 { 00028 public: 00029 GlfHeader(); 00030 ~GlfHeader(); 00031 00032 // Copy Constructor 00033 GlfHeader(const GlfHeader& header); 00034 00035 // Overload operator = to copy the passed in header into this header. 00036 GlfHeader & operator = (const GlfHeader& header); 00037 00038 // Overload operator = to copy the passed in header into this header. 00039 bool copy(const GlfHeader& header); 00040 00041 void resetHeader(); 00042 00043 // Read the header from the specified file. Assumes the file is in 00044 // the correct position for reading the header. 00045 bool read(IFILE filePtr); 00046 00047 // Write the header to the specified file. 00048 bool write(IFILE filePtr) const; 00049 00050 // Set the passed in string to the text string stored in this header. 00051 bool getHeaderTextString(std::string& text); 00052 00053 // Set the header to the passed in string. 00054 bool setHeaderTextString(const std::string& text); 00055 00056 private: 00057 // std::string myText; 00058 00059 int32_t myTextLen; 00060 CharBuffer myText; 00061 00062 static const std::string GLF_MAGIC; 00063 static const int GLF_MAGIC_LEN; 00064 }; 00065 00066 #endif 00067