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

Method appendToString

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

Source from the content-addressed store, hash-verified

117}
118
119void Read::appendToString(string* target) {
120 size_t nameLen = mName->length();
121 size_t seqLen = mSeq->length();
122 size_t strandLen = mStrand->length();
123 size_t qualLen = mQuality->length();
124 size_t totalSize = nameLen + seqLen + strandLen + qualLen + 4;
125
126 size_t oldSize = target->size();
127 target->resize(oldSize + totalSize);
128 char* dst = &(*target)[oldSize];
129
130 memcpy(dst, mName->data(), nameLen); dst += nameLen; *dst++ = '\n';
131 memcpy(dst, mSeq->data(), seqLen); dst += seqLen; *dst++ = '\n';
132 memcpy(dst, mStrand->data(), strandLen); dst += strandLen; *dst++ = '\n';
133 memcpy(dst, mQuality->data(), qualLen); dst += qualLen; *dst++ = '\n';
134}
135
136void Read::appendToStringWithTag(string* target, const char* tag) {
137 size_t nameLen = mName->length();

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