]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/SamHeader.cpp
Minor update to API version 0.9.3 - addition of SamHeader::SetHeaderText().
[bamtools.git] / src / api / SamHeader.cpp
index 74381f0967df4e4181a0919835b512cd0f09d723..5134630a7d3a65b11e7e0fe07afe0357ed74e328 100644 (file)
@@ -58,6 +58,16 @@ void SamHeader::Clear(void) {
     Comments.clear();
 }
 
+void SamHeader::SetHeaderText(const std::string& headerText) {
+
+    // clear prior data
+    Clear();
+
+    // parse header text into data
+    SamFormatParser parser(*this);
+    parser.Parse(headerText);
+}
+
 // retrieve the SAM header, with any local modifications
 string SamHeader::ToString(void) const {
     SamFormatPrinter printer(*this);