Пример #1
0
 create_parser_type get_creator_function(const osmium::io::File& file) {
     auto it = m_callbacks.find(file.format());
     if (it == m_callbacks.end()) {
         throw unsupported_file_format_error(
                 std::string("Can not open file '") +
                 file.filename() +
                 "' with type '" +
                 as_string(file.format()) +
                 "'. No support for reading this format in this program.");
     }
     return it->second;
 }
Пример #2
0
                std::unique_ptr<osmium::io::detail::OutputFormat> create_output(const osmium::io::File& file, future_string_queue_type& output_queue) {
                    auto it = m_callbacks.find(file.format());
                    if (it != m_callbacks.end()) {
                        return std::unique_ptr<osmium::io::detail::OutputFormat>((it->second)(file, output_queue));
                    }

                    throw unsupported_file_format_error(
                                std::string("Can not open file '") +
                                file.filename() +
                                "' with type '" +
                                as_string(file.format()) +
                                "'. No support for writing this format in this program.");
                }
Пример #3
0
 OSMIUM_NORETURN void error(osmium::io::file_compression compression) {
     std::string error_message {"Support for compression '"};
     error_message += as_string(compression);
     error_message += "' not compiled into this binary.";
     throw unsupported_file_format_error(error_message);
 }