Libosmium
2.15.4
Fast and flexible C++ library for working with OpenStreetMap data
include
osmium
io
file_format.hpp
Go to the documentation of this file.
1
#ifndef OSMIUM_IO_FILE_FORMAT_HPP
2
#define OSMIUM_IO_FILE_FORMAT_HPP
3
4
/*
5
6
This file is part of Osmium (https://osmcode.org/libosmium).
7
8
Copyright 2013-2019 Jochen Topf <jochen@topf.org> and others (see README).
9
10
Boost Software License - Version 1.0 - August 17th, 2003
11
12
Permission is hereby granted, free of charge, to any person or organization
13
obtaining a copy of the software and accompanying documentation covered by
14
this license (the "Software") to use, reproduce, display, distribute,
15
execute, and transmit the Software, and to prepare derivative works of the
16
Software, and to permit third-parties to whom the Software is furnished to
17
do so, all subject to the following:
18
19
The copyright notices in the Software and this entire statement, including
20
the above license grant, this restriction and the following disclaimer,
21
must be included in all copies of the Software, in whole or in part, and
22
all derivative works of the Software, unless such copies or derivative
23
works are solely in the form of machine-executable object code generated by
24
a source language processor.
25
26
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
29
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
30
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
31
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
32
DEALINGS IN THE SOFTWARE.
33
34
*/
35
36
#include <iosfwd>
37
38
namespace
osmium
{
39
40
namespace
io {
41
42
enum class
file_format
{
43
unknown
= 0,
44
xml
= 1,
45
pbf
= 2,
46
opl
= 3,
47
json
= 4,
48
o5m
= 5,
49
debug
= 6,
50
blackhole
= 7,
51
last
= 7
// must have the same value as the last real value
52
};
53
54
enum class
read_meta
{
55
no
= 0,
56
yes
= 1
57
};
58
59
inline
const
char
*
as_string
(
const
file_format
format) noexcept {
60
switch
(format) {
61
case
file_format::xml
:
62
return
"XML"
;
63
case
file_format::pbf
:
64
return
"PBF"
;
65
case
file_format::opl
:
66
return
"OPL"
;
67
case
file_format::json
:
68
return
"JSON"
;
69
case
file_format::o5m
:
70
return
"O5M"
;
71
case
file_format::debug
:
72
return
"DEBUG"
;
73
case
file_format::blackhole
:
74
return
"BLACKHOLE"
;
75
default
:
// file_format::unknown
76
break
;
77
}
78
return
"unknown"
;
79
}
80
81
template
<
typename
TChar,
typename
TTraits>
82
inline
std::basic_ostream<TChar, TTraits>&
operator<<
(std::basic_ostream<TChar, TTraits>& out,
const
file_format
format) {
83
return
out <<
as_string
(format);
84
}
85
86
}
// namespace io
87
88
}
// namespace osmium
89
90
#endif // OSMIUM_IO_FILE_FORMAT_HPP
osmium::io::file_format::blackhole
@ blackhole
osmium::io::read_meta::yes
@ yes
osmium::io::file_format::unknown
@ unknown
osmium::io::file_format::opl
@ opl
osmium::io::file_format::json
@ json
osmium::io::operator<<
std::basic_ostream< TChar, TTraits > & operator<<(std::basic_ostream< TChar, TTraits > &out, const file_compression compression)
Definition:
file_compression.hpp:61
osmium::io::file_format::pbf
@ pbf
osmium::io::file_format
file_format
Definition:
file_format.hpp:42
osmium
Namespace for everything in the Osmium library.
Definition:
assembler.hpp:53
osmium::io::file_format::o5m
@ o5m
osmium::io::file_format::debug
@ debug
osmium::io::read_meta
read_meta
Definition:
file_format.hpp:54
osmium::io::file_format::last
@ last
osmium::io::as_string
const char * as_string(file_compression compression)
Definition:
file_compression.hpp:48
osmium::io::file_format::xml
@ xml
osmium::io::read_meta::no
@ no
Generated by
1.8.17