| 574 | } |
| 575 | |
| 576 | void StringReader::ParseFile() |
| 577 | { |
| 578 | _strgen.warnings = _strgen.errors = 0; |
| 579 | |
| 580 | _strgen.translation = this->translation; |
| 581 | _strgen.file = this->file; |
| 582 | |
| 583 | /* For each new file we parse, reset the genders, and language codes. */ |
| 584 | _strgen.lang = {}; |
| 585 | |
| 586 | _strgen.cur_line = 1; |
| 587 | while (this->data.next_string_id < this->data.max_strings) { |
| 588 | std::optional<std::string> line = this->ReadLine(); |
| 589 | if (!line.has_value()) return; |
| 590 | |
| 591 | this->HandleString(StrTrimView(line.value(), StringConsumer::WHITESPACE_OR_NEWLINE)); |
| 592 | _strgen.cur_line++; |
| 593 | } |
| 594 | |
| 595 | if (this->data.next_string_id == this->data.max_strings) { |
| 596 | StrgenError("Too many strings, maximum allowed is {}", this->data.max_strings); |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Write the header information. |
no test coverage detected