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; }
std::unique_ptr<osmium::io::detail::OutputFormat> create_output(osmium::thread::Pool& pool, const osmium::io::File& file, future_string_queue_type& output_queue) const { const auto func = callbacks(file.format()); if (func) { return std::unique_ptr<osmium::io::detail::OutputFormat>((func)(pool, 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."}; }
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."); }
std::unique_ptr<osmium::io::detail::OutputFormat> create_output(const osmium::io::File& file, data_queue_type& output_queue) { file.check(); 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 std::runtime_error(std::string("Support for output format '") + as_string(file.format()) + "' not compiled into this binary."); }
std::unique_ptr<osmium::io::detail::InputFormat> create_input(const osmium::io::File& file, osmium::osm_entity_bits::type read_which_entities, osmium::thread::Queue<std::string>& input_queue) { file.check(); auto it = m_callbacks.find(file.format()); if (it != m_callbacks.end()) { return std::unique_ptr<osmium::io::detail::InputFormat>((it->second)(file, read_which_entities, input_queue)); } throw std::runtime_error(std::string("Support for input format '") + as_string(file.format()) + "' not compiled into this binary."); }