]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/SamSequenceDictionary.cpp
MultiReader (&MultiMerger) now using Algorithms::Sort objects
[bamtools.git] / src / api / SamSequenceDictionary.cpp
index 3e5240df386099cc5199fe0d3d173d5374b22303..0c9258137e83b31023dd2a68e9a21043cb23dda5 100644 (file)
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College
 // All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 18 April 2011 (DB)
+// Last modified: 1 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Provides methods for operating on a collection of SamSequence entries.
 // *************************************************************************
@@ -65,6 +65,13 @@ void SamSequenceDictionary::Add(const std::string& name, const int& length) {
     Add( SamSequence(name, length) );
 }
 
+void SamSequenceDictionary::Add(const SamSequenceDictionary& sequences) {
+    SamSequenceConstIterator seqIter = sequences.ConstBegin();
+    SamSequenceConstIterator seqEnd  = sequences.ConstEnd();
+    for ( ; seqIter != seqEnd; ++seqIter )
+        Add(*seqIter);
+}
+
 /*! \fn void SamSequenceDictionary::Add(const std::vector<SamSequence>& sequences)
     \brief Adds multiple sequences to the dictionary.