1#ifndef OSMIUM_OSM_METADATA_OPTIONS_HPP
2#define OSMIUM_OSM_METADATA_OPTIONS_HPP
70 if (attributes.empty() || attributes ==
"all" || attributes ==
"true" || attributes ==
"yes") {
73 if (attributes ==
"none" || attributes ==
"false" || attributes ==
"no") {
79 unsigned int opts = 0;
80 for (
const auto& attr : attrs) {
81 if (attr ==
"version") {
83 }
else if (attr ==
"timestamp") {
85 }
else if (attr ==
"changeset") {
87 }
else if (attr ==
"uid") {
89 }
else if (attr ==
"user") {
92 throw std::invalid_argument{std::string{
"Unknown OSM object metadata attribute: '"} + attr +
"'"};
99 bool any() const noexcept {
104 bool all() const noexcept {
149 bool uid() const noexcept {
197 result +=
"version+";
201 result +=
"timestamp+";
205 result +=
"changeset+";
226 template <
typename TChar,
typename TTraits>
227 inline std::basic_ostream<TChar, TTraits>&
operator<<(std::basic_ostream<TChar, TTraits>& out,
const metadata_options& options) {
228 return out << options.to_string();
244 opts.
set_uid(
object.uid() > 0);
245 opts.
set_user(
object.user()[0] !=
'\0');
Namespace for everything in the Osmium library.
Definition assembler.hpp:53
std::vector< std::string > split_string(const std::string &str, const char sep, bool compact=false)
Definition string.hpp:50
osmium::metadata_options detect_available_metadata(const osmium::OSMObject &object)
Definition metadata_options.hpp:235
std::basic_ostream< TChar, TTraits > & operator<<(std::basic_ostream< TChar, TTraits > &out, const item_type item_type)
Definition item_type.hpp:187
Definition location.hpp:654