SamHeaderTag.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "SamHeaderTag.h"
00019
00020
00021 SamHeaderTag::SamHeaderTag(const char* tag, const char* value)
00022 {
00023 setTag(tag, value);
00024 }
00025
00026
00027 SamHeaderTag::SamHeaderTag(const SamHeaderTag& oldTag)
00028 {
00029 setTag(oldTag.myTag.c_str(), oldTag.myValue.c_str());
00030 }
00031
00032
00033 SamHeaderTag::~SamHeaderTag()
00034 {
00035 }
00036
00037
00038
00039
00040 bool SamHeaderTag::getTagString(std::string& tagString)
00041 {
00042 if(myValue.length() != 0)
00043 {
00044
00045 tagString += "\t";
00046 tagString += myTag;
00047 tagString += ":";
00048 tagString += myValue;
00049 return(true);
00050 }
00051
00052 return(false);
00053 }
00054
00055
00056
00057 bool SamHeaderTag::setTag(const char* tag, const char* value)
00058 {
00059 myTag = tag;
00060 myValue = value;
00061 return(true);
00062 }
00063
00064
00065
00066 bool SamHeaderTag::setValue(const char* value)
00067 {
00068 myValue = value;
00069 return(true);
00070 }
00071
00072
00073
00074 const char* SamHeaderTag::getTag()
00075 {
00076 return(myTag.c_str());
00077 }
00078
00079
00080
00081 const char* SamHeaderTag::getValue()
00082 {
00083 return(myValue.c_str());
00084 }
00085
00086
00087
00088 bool SamHeaderTag::hasValue()
00089 {
00090 return(myValue.size() != 0);
00091 }