osrm-backend/examples/osmium_read.cpp
Patrick Niklaus 8511256779 Squashed 'third_party/libosmium/' content from commit 2282c84
git-subtree-dir: third_party/libosmium
git-subtree-split: 2282c8450bae55839372a2002db7ca754530d2fc
2016-03-01 17:56:55 +01:00

31 lines
565 B
C++

/*
This is a small tool that reads and discards the contents of the input file.
(Used for timing.)
The code in this example file is released into the Public Domain.
*/
#include <iostream>
#include <osmium/io/any_input.hpp>
int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " OSMFILE\n";
exit(1);
}
osmium::io::File infile(argv[1]);
osmium::io::Reader reader(infile);
while (osmium::memory::Buffer buffer = reader.read()) {
// do nothing
}
reader.close();
}