MCPcopy Create free account
hub / github.com/OpenGene/fastplong / appendToStringWithTag

Method appendToStringWithTag

src/read.cpp:145–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void Read::appendToStringWithTag(string* target, string tag) {
146 size_t size = mName->length() + 1 + tag.length() + mSeq->length() + mStrand->length() + mQuality->length() + 4;
147 char* str = new char[size + 1];
148 size_t total = 0;
149 memcpy(str + total, mName->data(), mName->length());
150 total += mName->length();
151 str[total] = ' ';
152 total++;
153 memcpy(str + total, tag.data(), tag.length());
154 total += tag.length();
155 str[total] = '\n';
156 total++;
157 memcpy(str + total, mSeq->data(), mSeq->length());
158 total += mSeq->length();
159 str[total] = '\n';
160 total++;
161 memcpy(str + total, mStrand->data(), mStrand->length());
162 total += mStrand->length();
163 str[total] = '\n';
164 total++;
165 memcpy(str + total, mQuality->data(), mQuality->length());
166 total += mQuality->length();
167 str[total] = '\n';
168 total++;
169 str[total] = '\0';
170
171 target->append(str, size);
172 delete[] str;
173}
174
175string Read::toStringWithTag(string tag) {
176 return *mName + " " + tag + "\n" + *mSeq + "\n" + *mStrand + "\n" + *mQuality + "\n";

Callers 1

processSingleEndMethod · 0.80

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected