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