File: CigarString.h

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (23 lines) | stat: -rw-r--r-- 516 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _BLASR_SAM_CIGAR_STRING_HPP_
#define _BLASR_SAM_CIGAR_STRING_HPP_

#include <string>
#include <sstream>

class CigarString : public std::string {
public:
    void Vectorize(std::vector<int> &lengths, std::vector<char> &operations) {
        std::stringstream strm;
        strm.str(*this);
        while (strm) {
            int l;
            char o;
            if ((strm >> l >> o)) {
                lengths.push_back(l);
                operations.push_back(o);
            }
        }
    }
};

#endif