MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / readNext

Method readNext

src/openms/source/FORMAT/FASTAFile.cpp:149–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 bool FASTAFile::readNext(FASTAEntry &protein)
150 {
151 if (infile_.eof())
152 {
153 return false;
154 }
155
156 seq_.clear(); // Note: it is fine to clear() after std::move as it will turn the "valid but unspecified state" into a specified (the empty) one
157 id_.clear();
158 description_.clear();
159
160 if (!readEntry_(id_, description_, seq_))
161 {
162 if (entries_read_ == 0)
163 {
164 seq_ = "The first entry could not be read!";
165 }
166 else
167 {
168 seq_ = "Only " + String(entries_read_) + " proteins could be read. Parsing next record failed.";
169 }
170 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "",
171 "Error while parsing FASTA file! " + seq_ + " Please check the file!");
172 }
173 ++entries_read_;
174
175 protein.identifier = std::move(id_);
176 protein.description = std::move(description_);
177 protein.sequence = std::move(seq_);
178
179 return true;
180 }
181
182 std::streampos FASTAFile::position()
183 {

Callers 7

main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
loadMethod · 0.80
cacheChunkMethod · 0.80
readAtMethod · 0.80
FASTAFile_test.cppFile · 0.80

Calls 2

StringClass · 0.50
clearMethod · 0.45

Tested by

no test coverage detected