libStatGen Software
1
|
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 __SAMHEADER_TAG_H__ 00019 #define __SAMHEADER_TAG_H__ 00020 00021 #include <string> 00022 00023 class SamHeaderTag 00024 { 00025 public: 00026 SamHeaderTag(const char* tag, const char* value); 00027 SamHeaderTag(const SamHeaderTag&); 00028 00029 ~SamHeaderTag(); 00030 00031 // Add this tag to the passed in tag string. 00032 // If the tag value is blank, the tag will not be added to the 00033 // passed in string. 00034 // NOTE: does not clear tagString. 00035 bool getTagString(std::string& tagString); 00036 00037 // Set this tag to the passed in tag and value. 00038 bool setTag(const char* tag, const char* value); 00039 00040 // Set the value associated with this tag to the passed in value. 00041 bool setValue(const char* value); 00042 00043 // Return the tag for this tag. 00044 const char* getTag(); 00045 00046 // Return the value associated with this tag. 00047 const char* getValue(); 00048 00049 // Return true if there is a non-blank value associated with this tag. 00050 bool hasValue(); 00051 00052 private: 00053 SamHeaderTag(); 00054 SamHeaderTag& operator=(const SamHeaderTag&); 00055 00056 std::string myTag; 00057 std::string myValue; 00058 }; 00059 00060 #endif