1 #ifndef OSMIUM_OSM_METADATA_OPTIONS_HPP 2 #define OSMIUM_OSM_METADATA_OPTIONS_HPP 67 if (attributes.empty() || attributes ==
"all" || attributes ==
"true" || attributes ==
"yes") {
70 if (attributes ==
"none" || attributes ==
"false" || attributes ==
"no") {
77 for (
const auto& attr : attrs) {
78 if (attr ==
"version") {
79 opts |= options::md_version;
80 }
else if (attr ==
"timestamp") {
81 opts |= options::md_timestamp;
82 }
else if (attr ==
"changeset") {
83 opts |= options::md_changeset;
84 }
else if (attr ==
"uid") {
85 opts |= options::md_uid;
86 }
else if (attr ==
"user") {
87 opts |= options::md_user;
89 throw std::invalid_argument{std::string{
"Unknown OSM object metadata attribute: '"} + attr +
"'"};
96 bool any() const noexcept {
101 bool all() const noexcept {
111 return (
m_options & options::md_version) != 0;
123 return (
m_options & options::md_timestamp) != 0;
135 return (
m_options & options::md_changeset) != 0;
146 bool uid() const noexcept {
147 return (
m_options & options::md_uid) != 0;
159 return (
m_options & options::md_user) != 0;
194 result +=
"version+";
198 result +=
"timestamp+";
202 result +=
"changeset+";
221 template <
typename TChar,
typename TTraits>
222 inline std::basic_ostream<TChar, TTraits>& operator<<(std::basic_ostream<TChar, TTraits>& out,
const metadata_options&
options) {
223 return out <<
options.to_string();
247 #endif // OSMIUM_OSM_METADATA_OPTIONS_HPP
Definition: location.hpp:554
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
osmium::metadata_options detect_available_metadata(const osmium::OSMObject &object)
Definition: metadata_options.hpp:230
std::vector< std::string > split_string(const std::string &str, const char sep, bool compact=false)
Definition: string.hpp:50
Definition: object.hpp:64