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

Method appendToString

src/read.cpp:119–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void 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
145void Read::appendToStringWithTag(string* target, string tag) {
146 size_t size = mName->length() + 1 + tag.length() + mSeq->length() + mStrand->length() + mQuality->length() + 4;

Callers 1

processSingleEndMethod · 0.80

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected