1 #ifndef OSMIUM_OSM_CHANGESET_HPP 2 #define OSMIUM_OSM_CHANGESET_HPP 53 class ChangesetDiscussionBuilder;
54 class ChangesetBuilder;
78 const unsigned char*
endpos()
const {
82 template <
typename TMember>
89 unsigned const char*
next()
const {
120 const char*
user() const noexcept {
124 const char*
text() const noexcept {
160 int16_t m_padding1 {0};
161 int32_t m_padding2 {0};
187 return m_padding1 + m_padding2;
240 m_uid = uid < 0 ? 0 : static_cast<user_id_type>(uid);
291 m_created_at = timestamp;
302 m_closed_at = timestamp;
308 return m_num_changes;
313 m_num_changes = num_changes;
324 return m_num_comments;
329 m_num_comments = num_comments;
358 return reinterpret_cast<const char*
>(data() +
sizeof(
Changeset));
363 return osmium::detail::subitem_of_type<const TagList>(cbegin(), cend());
374 if (!std::strcmp(attr,
"id")) {
376 }
else if (!std::strcmp(attr,
"num_changes")) {
377 set_num_changes(value);
378 }
else if (!std::strcmp(attr,
"comments_count")) {
379 set_num_comments(value);
380 }
else if (!std::strcmp(attr,
"created_at")) {
382 }
else if (!std::strcmp(attr,
"closed_at")) {
384 }
else if (!std::strcmp(attr,
"uid")) {
393 return iterator(subitems_position());
397 return iterator(data() + padded_size());
417 return osmium::detail::subitem_of_type<ChangesetDiscussion>(
begin(),
end());
421 return osmium::detail::subitem_of_type<const ChangesetDiscussion>(cbegin(), cend());
431 return lhs.
id() == rhs.
id();
435 return ! (lhs == rhs);
442 return lhs.
id() < rhs.
id();
450 return ! (rhs < lhs);
454 return ! (lhs < rhs);
459 #endif // OSMIUM_OSM_CHANGESET_HPP uint32_t user_id_type
Type for OSM user IDs.
Definition: types.hpp:49
osmium::Timestamp m_closed_at
Definition: changeset.hpp:154
const_iterator begin() const
Definition: changeset.hpp:408
Definition: changeset.hpp:130
string_size_type user_size() const noexcept
Definition: changeset.hpp:171
Definition: collection.hpp:47
num_comments_type num_comments() const noexcept
Get the number of comments in this changeset.
Definition: changeset.hpp:323
bool operator<=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:449
osmium::Box & bounds() noexcept
Definition: changeset.hpp:343
bool open() const noexcept
Is this changeset open?
Definition: changeset.hpp:275
string_size_type m_user_size
Definition: changeset.hpp:159
constexpr bool operator==(const Box &lhs, const Box &rhs) noexcept
Definition: box.hpp:221
void set_attribute(const char *attr, const char *value)
Definition: changeset.hpp:373
user_id_type uid() const noexcept
Get user id.
Definition: changeset.hpp:217
item_type
Definition: item_type.hpp:43
Changeset & set_uid_from_signed(signed_user_id_type uid) noexcept
Definition: changeset.hpp:239
uint16_t string_size_type
Definition: types.hpp:59
const TagList & tags() const
Get the list of tags.
Definition: changeset.hpp:362
changeset_id_type id() const noexcept
Get ID of this changeset.
Definition: changeset.hpp:191
OSMEntity is the abstract base class for the OSMObject and Changeset classes.
Definition: entity.hpp:64
uint32_t num_changes_type
Type for changeset num_changes.
Definition: types.hpp:51
Changeset & set_num_changes(const char *num_changes)
Set the number of changes in this changeset.
Definition: changeset.hpp:318
constexpr std::size_t padded_length(std::size_t length) noexcept
Definition: item.hpp:64
Definition: osm_object_builder.hpp:304
const_iterator end() const
Definition: changeset.hpp:412
iterator begin()
Definition: changeset.hpp:392
Changeset & set_id(changeset_id_type id) noexcept
Definition: changeset.hpp:201
osmium::Timestamp closed_at() const noexcept
Definition: changeset.hpp:270
bool operator<(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:441
Namespace for everything in the Osmium library.
Definition: assembler.hpp:73
Changeset & set_uid(const char *uid)
Definition: changeset.hpp:250
void set_user_size(string_size_type size) noexcept
Definition: changeset.hpp:167
Changeset & set_num_changes(num_changes_type num_changes) noexcept
Set the number of changes in this changeset.
Definition: changeset.hpp:312
const_iterator cbegin() const
Definition: changeset.hpp:400
uint32_t num_comments_type
Type for changeset num_comments.
Definition: types.hpp:52
num_changes_type num_changes() const noexcept
Get the number of changes in this changeset.
Definition: changeset.hpp:307
Definition: collection.hpp:117
int32_t signed_user_id_type
Type for signed OSM user IDs.
Definition: types.hpp:50
Definition: timestamp.hpp:115
osmium::io::InputIterator< osmium::io::Reader > end(osmium::io::Reader &)
Definition: reader_iterator.hpp:45
osmium::Timestamp m_created_at
Definition: changeset.hpp:153
uint32_t changeset_id_type
Type for OSM changeset IDs.
Definition: types.hpp:48
changeset_id_type string_to_changeset_id(const char *input)
Definition: types_from_string.hpp:144
const_iterator cend() const
Definition: changeset.hpp:404
bool user_is_anonymous() const noexcept
Is this user anonymous?
Definition: changeset.hpp:255
Changeset & set_num_comments(num_comments_type num_comments) noexcept
Set the number of comments in this changeset.
Definition: changeset.hpp:328
osmium::Box m_bounds
Definition: changeset.hpp:152
osmium::Timestamp created_at() const noexcept
Get timestamp when this changeset was created.
Definition: changeset.hpp:260
Changeset()
Definition: changeset.hpp:163
unsigned char * data() const noexcept
Definition: collection.hpp:91
iterator end()
Definition: changeset.hpp:396
bool operator>=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:453
signed_user_id_type string_to_user_id(const char *input)
Definition: types_from_string.hpp:158
Changeset & set_num_comments(const char *num_comments)
Set the number of comments in this changeset.
Definition: changeset.hpp:334
bool operator>(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:445
const ChangesetDiscussion & discussion() const
Definition: changeset.hpp:420
unsigned char * subitems_position()
Definition: changeset.hpp:175
ChangesetDiscussion & discussion()
Definition: changeset.hpp:416
int32_t do_not_use() const noexcept
Definition: changeset.hpp:186
uint32_t size() const noexcept
Definition: builder.hpp:141
const char * user() const
Get user name.
Definition: changeset.hpp:357
Changeset & set_created_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:290
An OSM Changeset, a group of changes made by a single user over a short period of time...
Definition: changeset.hpp:148
const osmium::Box & bounds() const noexcept
Definition: changeset.hpp:352
Changeset & set_closed_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:301
Definition: osm_object_builder.hpp:556
bool closed() const noexcept
Is this changeset closed?
Definition: changeset.hpp:280
const unsigned char * subitems_position() const
Definition: changeset.hpp:179
osmium::io::InputIterator< osmium::io::Reader > begin(osmium::io::Reader &reader)
Definition: reader_iterator.hpp:41
ChangesetDiscussion()
Definition: changeset.hpp:134
num_comments_type string_to_num_comments(const char *input)
Definition: types_from_string.hpp:189
bool operator!=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:434
Changeset & set_id(const char *id)
Definition: changeset.hpp:212
num_changes_type string_to_num_changes(const char *input)
Definition: types_from_string.hpp:175
Builder & operator=(const Builder &)=delete
Changeset & set_uid(user_id_type uid) noexcept
Definition: changeset.hpp:227