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

Method appendToStringWithTag

src/read.cpp:136–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void Read::appendToStringWithTag(string* target, const char* tag) {
137 size_t nameLen = mName->length();
138 size_t tagLen = strlen(tag);
139 size_t seqLen = mSeq->length();
140 size_t strandLen = mStrand->length();
141 size_t qualLen = mQuality->length();
142 size_t totalSize = nameLen + 1 + tagLen + seqLen + strandLen + qualLen + 4;
143
144 size_t oldSize = target->size();
145 target->resize(oldSize + totalSize);
146 char* dst = &(*target)[oldSize];
147
148 memcpy(dst, mName->data(), nameLen); dst += nameLen;
149 *dst++ = ' ';
150 memcpy(dst, tag, tagLen); dst += tagLen; *dst++ = '\n';
151 memcpy(dst, mSeq->data(), seqLen); dst += seqLen; *dst++ = '\n';
152 memcpy(dst, mStrand->data(), strandLen); dst += strandLen; *dst++ = '\n';
153 memcpy(dst, mQuality->data(), qualLen); dst += qualLen; *dst++ = '\n';
154}
155
156string Read::toStringWithTag(const char* tag) {
157 return *mName + " " + tag + "\n" + *mSeq + "\n" + *mStrand + "\n" + *mQuality + "\n";

Callers 2

processPairEndMethod · 0.80
processSingleEndMethod · 0.80

Calls 3

resizeMethod · 0.80
lengthMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected