-// overload to support std::string
-void SamSequenceDictionary::Add(const vector<string>& sequenceNames) {
- vector<string>::const_iterator rgIter = sequenceNames.begin();
- vector<string>::const_iterator rgEnd = sequenceNames.end();
- for ( ; rgIter!= rgEnd; ++rgIter )
- Add(*rgIter);
+/*! \fn void SamSequenceDictionary::Add(const std::map<std::string, int>& sequenceMap)
+ \brief Adds multiple sequences to the dictionary.
+
+ This is an overloaded function.
+
+ \param sequenceMap map of sequence entries (name => length) to be added
+ \sa Add()
+*/
+void SamSequenceDictionary::Add(const std::map<std::string, int>& sequenceMap) {
+ map<string, int>::const_iterator seqIter = sequenceMap.begin();
+ map<string, int>::const_iterator seqEnd = sequenceMap.end();
+ for ( ; seqIter != seqEnd; ++seqIter ) {
+ const string& name = (*seqIter).first;
+ const int& length = (*seqIter).second;
+ Add( SamSequence(name, length) );
+ }