| 9 | namespace transit |
| 10 | { |
| 11 | TransitVersion GetVersion(Reader & reader) |
| 12 | { |
| 13 | try |
| 14 | { |
| 15 | NonOwningReaderSource src(reader); |
| 16 | uint16_t headerVersion = std::numeric_limits<uint16_t>::max(); |
| 17 | ReadPrimitiveFromSource(src, headerVersion); |
| 18 | CHECK_LESS(headerVersion, static_cast<uint16_t>(TransitVersion::Counter), ("Invalid transit header version.")); |
| 19 | |
| 20 | return static_cast<TransitVersion>(headerVersion); |
| 21 | } |
| 22 | catch (std::exception const & ex) |
| 23 | { |
| 24 | LOG(LERROR, ("Error reading header version from transit mwm section.", ex.what())); |
| 25 | throw; |
| 26 | } |
| 27 | } |
| 28 | } // namespace transit |
no test coverage detected