osmium::io Namespace Reference

Everything related to input and output of OSM data. More...

## Classes

class | Bzip2BufferDecompressor
class | Bzip2Compressor
class | Bzip2Decompressor
class | CompressionFactory
class | Compressor
class | Decompressor
class | File
class | GzipBufferDecompressor
class | GzipCompressor
class | GzipDecompressor
class | Header
class | InputIterator
class | InputIteratorRange
class | NoCompressor
class | NoDecompressor
class | OutputIterator
class | Reader
class | Writer

## Enumerations

enum | file_compression { file_compression::none = 0, file_compression::gzip = 1, file_compression::bzip2 = 2 }
enum | file_format { file_format::unknown = 0, file_format::xml = 1, file_format::pbf = 2, file_format::opl = 3, file_format::json = 4, file_format::o5m = 5, file_format::debug = 6 }
enum | overwrite : bool { overwrite::no = false, overwrite::allow = true }
enum | fsync : bool { fsync::no = false, fsync::yes = true }

## Functions

const char * | as_string (file_compression compression)
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const file_compression compression)
const char * | as_string (file_format format)
template<typename TChar , typename TTraits >
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const file_format format)
template<typename TItem , typename TSource >
InputIteratorRange< TSource, TItem > | make_input_iterator_range (TSource &source)
template<typename TDest >
OutputIterator< TDest > | make_output_iterator (TDest &destination)
template<typename TDest >
OSMIUM_DEPRECATED OutputIterator< TDest > | make_output_iterator (TDest &destination, const size_t buffer_size)
template<typename... TArgs>
osmium::memory::Buffer | read_file (TArgs &&...args)

## Detailed Description

Everything related to input and output of OSM data.

## Enumeration Type Documentation

enum osmium::io::file_compression

strong

Enumerator
none |
gzip |
bzip2 |

enum osmium::io::file_format

strong

Enumerator
unknown |
xml |
pbf |
opl |
json |
o5m |
debug |

enum osmium::io::fsync : bool

strong

Should writer do an fsync before closing the file?

Enumerator
no |
yes |

enum osmium::io::overwrite : bool

strong

Allow overwriting of existing file?

Enumerator
no |
allow |

## Function Documentation

const char* osmium::io::as_string | ( | file_compression | compression | ) |

inline

const char* osmium::io::as_string | ( | file_format | format | ) |

inline

template<typename TItem , typename TSource >

InputIteratorRange<TSource, TItem> osmium::io::make_input_iterator_range | ( | TSource & | source | ) |

template<typename TDest >

OutputIterator<TDest> osmium::io::make_output_iterator | ( | TDest & | destination | ) |

template<typename TDest >

OSMIUM_DEPRECATED OutputIterator<TDest> osmium::io::make_output_iterator | ( | TDest & | destination,
|  | const size_t | buffer_size
| ) |  |

Deprecated:
  Use of buffer size argument on make_output_iterator is deprecated. Call Writer::set_buffer_size() instead if you want to change the default.

template<typename TChar , typename TTraits >

std::basic_ostream<TChar, TTraits>& osmium::io::operator<< | ( | std::basic_ostream< TChar, TTraits > & | out,
|  | const file_compression | compression
| ) |  |

inline

template<typename TChar , typename TTraits >

std::basic_ostream<TChar, TTraits>& osmium::io::operator<< | ( | std::basic_ostream< TChar, TTraits > & | out,
|  | const file_format | format
| ) |  |

inline

template<typename... TArgs>

osmium::memory::Buffer osmium::io::read_file | ( | TArgs &&... | args | ) |

Read contents of the given file into a buffer in one go. Takes the same arguments as any of the Reader constructors.

The buffer can take up quite a lot of memory, so don't do this unless you are working with small OSM files and/or have lots of RAM.