1#ifndef OSMIUM_OSM_CHANGESET_HPP
2#define OSMIUM_OSM_CHANGESET_HPP
53 class ChangesetDiscussionBuilder;
54 class ChangesetBuilder;
72 const unsigned char*
endpos()
const {
76 template <
typename TMember>
83 const unsigned char*
next()
const {
120 const char*
user() const noexcept {
124 const char*
text() const noexcept {
158 int16_t m_padding1 = 0;
159 int32_t m_padding2 = 0;
191 return m_padding1 + m_padding2;
244 m_uid = uid < 0 ? 0 : static_cast<user_id_type>(uid);
296 m_created_at = timestamp;
307 m_closed_at = timestamp;
313 return m_num_changes;
318 m_num_changes = num_changes;
329 return m_num_comments;
334 m_num_comments = num_comments;
357 const osmium::Box&
bounds() const noexcept {
363 return reinterpret_cast<const char*
>(data() +
sizeof(
Changeset));
368 std::memset(data() +
sizeof(
Changeset), 0, user_size());
373 return osmium::detail::subitem_of_type<const TagList>(
cbegin(),
cend());
384 if (!std::strcmp(attr,
"id")) {
386 }
else if (!std::strcmp(attr,
"num_changes")) {
387 set_num_changes(value);
388 }
else if (!std::strcmp(attr,
"comments_count")) {
389 set_num_comments(value);
390 }
else if (!std::strcmp(attr,
"created_at")) {
392 }
else if (!std::strcmp(attr,
"closed_at")) {
394 }
else if (!std::strcmp(attr,
"uid")) {
403 return iterator(subitems_position());
427 return osmium::detail::subitem_of_type<ChangesetDiscussion>(
begin(),
end());
431 return osmium::detail::subitem_of_type<const ChangesetDiscussion>(
cbegin(),
cend());
441 return lhs.
id() == rhs.
id();
445 return !(lhs == rhs);
452 return lhs.
id() < rhs.
id();
Definition: changeset.hpp:130
ChangesetDiscussion() noexcept=default
An OSM Changeset, a group of changes made by a single user over a short period of time.
Definition: changeset.hpp:146
num_comments_type num_comments() const noexcept
Get the number of comments in this changeset.
Definition: changeset.hpp:328
const ChangesetDiscussion & discussion() const
Definition: changeset.hpp:430
void set_user_size(string_size_type size) noexcept
Definition: changeset.hpp:165
const_iterator end() const
Definition: changeset.hpp:422
user_id_type uid() const noexcept
Get user id.
Definition: changeset.hpp:221
const_iterator cbegin() const
Definition: changeset.hpp:410
osmium::Box m_bounds
Definition: changeset.hpp:150
Changeset & set_id(const char *id)
Definition: changeset.hpp:216
const char * user() const
Get user name.
Definition: changeset.hpp:362
Changeset & set_uid_from_signed(signed_user_id_type uid) noexcept
Definition: changeset.hpp:243
void set_attribute(const char *attr, const char *value)
Definition: changeset.hpp:383
Changeset & set_id(changeset_id_type id) noexcept
Definition: changeset.hpp:205
osmium::Timestamp closed_at() const noexcept
Definition: changeset.hpp:275
int32_t do_not_use() const noexcept
Definition: changeset.hpp:190
const_iterator begin() const
Definition: changeset.hpp:418
Changeset()
Definition: changeset.hpp:161
string_size_type user_size() const noexcept
Definition: changeset.hpp:169
Changeset & set_num_comments(const char *num_comments)
Set the number of comments in this changeset.
Definition: changeset.hpp:339
Changeset & set_num_changes(num_changes_type num_changes) noexcept
Set the number of changes in this changeset.
Definition: changeset.hpp:317
Changeset & set_uid(user_id_type uid) noexcept
Definition: changeset.hpp:231
Changeset & set_created_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:295
Changeset & set_num_changes(const char *num_changes)
Set the number of changes in this changeset.
Definition: changeset.hpp:323
bool open() const noexcept
Is this changeset open?
Definition: changeset.hpp:280
static constexpr bool is_compatible_to(osmium::item_type t) noexcept
Definition: changeset.hpp:185
osmium::Timestamp created_at() const noexcept
Get timestamp when this changeset was created.
Definition: changeset.hpp:265
Changeset & set_num_comments(num_comments_type num_comments) noexcept
Set the number of comments in this changeset.
Definition: changeset.hpp:333
iterator begin()
Definition: changeset.hpp:402
osmium::Timestamp m_closed_at
Definition: changeset.hpp:152
osmium::Box & bounds() noexcept
Definition: changeset.hpp:348
bool user_is_anonymous() const noexcept
Is this user anonymous?
Definition: changeset.hpp:260
changeset_id_type id() const noexcept
Get ID of this changeset.
Definition: changeset.hpp:195
const TagList & tags() const
Get the list of tags.
Definition: changeset.hpp:372
void clear_user() noexcept
Clear user name.
Definition: changeset.hpp:367
Changeset & set_closed_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:306
const_iterator cend() const
Definition: changeset.hpp:414
ChangesetDiscussion & discussion()
Definition: changeset.hpp:426
Changeset & set_uid(const char *uid)
Definition: changeset.hpp:254
osmium::Timestamp m_created_at
Definition: changeset.hpp:151
const unsigned char * subitems_position() const
Definition: changeset.hpp:177
const osmium::Box & bounds() const noexcept
Definition: changeset.hpp:357
iterator end()
Definition: changeset.hpp:406
unsigned char * subitems_position()
Definition: changeset.hpp:173
bool closed() const noexcept
Is this changeset closed?
Definition: changeset.hpp:285
num_changes_type num_changes() const noexcept
Get the number of changes in this changeset.
Definition: changeset.hpp:312
OSMEntity is the abstract base class for the OSMObject and Changeset classes.
Definition: entity.hpp:64
Definition: timestamp.hpp:175
Definition: osm_object_builder.hpp:596
Definition: osm_object_builder.hpp:325
Definition: collection.hpp:47
unsigned char * data() const noexcept
Definition: collection.hpp:91
Definition: collection.hpp:181
static constexpr osmium::item_type itemtype
Definition: collection.hpp:192
CollectionIterator< ChangesetComment > iterator
Definition: collection.hpp:188
iterator end() noexcept
Definition: collection.hpp:224
size_type size() const noexcept
Definition: collection.hpp:216
CollectionIterator< const ChangesetComment > const_iterator
Definition: collection.hpp:189
const_iterator cend() const noexcept
Definition: collection.hpp:232
const_iterator cbegin() const noexcept
Definition: collection.hpp:228
iterator begin() noexcept
Definition: collection.hpp:220
item_size_type padded_size() const
Definition: item.hpp:167
constexpr std::size_t padded_length(std::size_t length) noexcept
Definition: item.hpp:64
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
changeset_id_type string_to_changeset_id(const char *input)
Definition: types_from_string.hpp:148
uint32_t changeset_comment_size_type
Definition: types.hpp:66
user_id_type string_to_uid(const char *input)
Definition: types_from_string.hpp:162
bool operator==(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:440
num_comments_type string_to_num_comments(const char *input)
Definition: types_from_string.hpp:190
int32_t signed_user_id_type
Type for signed OSM user IDs.
Definition: types.hpp:50
uint32_t user_id_type
Type for OSM user IDs.
Definition: types.hpp:49
bool operator<=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:459
uint32_t changeset_id_type
Type for OSM changeset IDs.
Definition: types.hpp:48
bool operator>(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:455
uint16_t string_size_type
Definition: types.hpp:59
item_type
Definition: item_type.hpp:45
bool operator>=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:463
bool operator!=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:444
uint32_t num_comments_type
Type for changeset num_comments.
Definition: types.hpp:52
num_changes_type string_to_num_changes(const char *input)
Definition: types_from_string.hpp:176
uint32_t num_changes_type
Type for changeset num_changes.
Definition: types.hpp:51
bool operator<(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:451