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

Method readStart

src/openms/source/FORMAT/FASTAFile.cpp:121–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119 }
120
121 void FASTAFile::readStart(const String& filename)
122 {
123
124 if (!File::exists(filename))
125 {
126 throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename);
127 }
128
129 if (!File::readable(filename))
130 {
131 throw Exception::FileNotReadable(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename);
132 }
133
134 if (infile_.is_open()) infile_.close(); // precaution
135
136 infile_.open(filename.c_str(), std::ios::binary | std::ios::in);
137 infile_.seekg(0, infile_.end);
138 fileSize_ = infile_.tellg();
139 infile_.seekg(0, infile_.beg);
140
141 std::streambuf *sb = infile_.rdbuf();
142 while (sb->sgetc() == '#') // Skip the header of PEFF files (http://www.psidev.info/peff)
143 {
144 infile_.ignore(numeric_limits<streamsize>::max(), '\n');
145 }
146 entries_read_ = 0;
147 }
148
149 bool FASTAFile::readNext(FASTAEntry &protein)
150 {

Callers 7

main_Method · 0.80
main_Method · 0.80
main_Method · 0.80
loadMethod · 0.80
FASTAContainerMethod · 0.80
resetMethod · 0.80
FASTAFile_test.cppFile · 0.80

Calls 3

rdbufMethod · 0.80
closeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected