| 117 | } |
| 118 | |
| 119 | void Read::appendToString(string* target) { |
| 120 | size_t size = mName->length() + mSeq->length() + mStrand->length() + mQuality->length() + 4; |
| 121 | char* str = new char[size + 1]; |
| 122 | size_t total = 0; |
| 123 | memcpy(str + total, mName->data(), mName->length()); |
| 124 | total += mName->length(); |
| 125 | str[total] = '\n'; |
| 126 | total++; |
| 127 | memcpy(str + total, mSeq->data(), mSeq->length()); |
| 128 | total += mSeq->length(); |
| 129 | str[total] = '\n'; |
| 130 | total++; |
| 131 | memcpy(str + total, mStrand->data(), mStrand->length()); |
| 132 | total += mStrand->length(); |
| 133 | str[total] = '\n'; |
| 134 | total++; |
| 135 | memcpy(str + total, mQuality->data(), mQuality->length()); |
| 136 | total += mQuality->length(); |
| 137 | str[total] = '\n'; |
| 138 | total++; |
| 139 | str[total] = '\0'; |
| 140 | |
| 141 | target->append(str, size); |
| 142 | delete[] str; |
| 143 | } |
| 144 | |
| 145 | void Read::appendToStringWithTag(string* target, string tag) { |
| 146 | size_t size = mName->length() + 1 + tag.length() + mSeq->length() + mStrand->length() + mQuality->length() + 4; |
no test coverage detected