1 | #include "NamesFormatReader.h" |
---|---|
2 | |
3 | #include <IO/ReadHelpers.h> |
4 | |
5 | |
6 | bool LanguageRegionsNamesFormatReader::readNext(RegionNameEntry & entry) |
7 | { |
8 | while (!input->eof()) |
9 | { |
10 | Int32 read_region_id; |
11 | std::string region_name; |
12 | |
13 | DB::readIntText(read_region_id, *input); |
14 | DB::assertChar('\t', *input); |
15 | DB::readString(region_name, *input); |
16 | DB::assertChar('\n', *input); |
17 | |
18 | if (read_region_id <= 0) |
19 | continue; |
20 | |
21 | entry.id = read_region_id; |
22 | entry.name = region_name; |
23 | return true; |
24 | } |
25 | |
26 | return false; |
27 | } |
28 |