| 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 | { |
no test coverage detected