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 {
246 m_uid = uid < 0 ? 0 : static_cast<user_id_type>(
uid);
297 m_created_at = timestamp;
308 m_closed_at = timestamp;
364 return reinterpret_cast<const char*
>(data() +
sizeof(
Changeset));
369 return osmium::detail::subitem_of_type<const TagList>(
cbegin(),
cend());
380 if (!std::strcmp(attr,
"id")) {
382 }
else if (!std::strcmp(attr,
"num_changes")) {
384 }
else if (!std::strcmp(attr,
"comments_count")) {
386 }
else if (!std::strcmp(attr,
"created_at")) {
388 }
else if (!std::strcmp(attr,
"closed_at")) {
390 }
else if (!std::strcmp(attr,
"uid")) {
423 return osmium::detail::subitem_of_type<ChangesetDiscussion>(
begin(),
end());
427 return osmium::detail::subitem_of_type<const ChangesetDiscussion>(
cbegin(),
cend());
437 return lhs.
id() == rhs.
id();
441 return ! (lhs == rhs);
448 return lhs.
id() < rhs.
id();
456 return ! (rhs < lhs);
460 return ! (lhs < rhs);
465 #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
Definition: changeset.hpp:130
string_size_type user_size() const noexcept
Definition: changeset.hpp:171
Definition: collection.hpp:47
num_changes_type m_num_changes
Definition: changeset.hpp:156
num_comments_type num_comments() const noexcept
Get the number of comments in this changeset.
Definition: changeset.hpp:329
osmium::memory::CollectionIterator< Item > iterator
Definition: changeset.hpp:395
bool operator<=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:455
osmium::Box & bounds() noexcept
Definition: changeset.hpp:349
bool open() const noexcept
Is this changeset open?
Definition: changeset.hpp:281
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:379
user_id_type uid() const noexcept
Get user id.
Definition: changeset.hpp:223
item_type
Definition: item_type.hpp:43
Changeset & set_uid_from_signed(signed_user_id_type uid) noexcept
Definition: changeset.hpp:245
const TagList & tags() const
Get the list of tags.
Definition: changeset.hpp:368
uint16_t string_size_type
Definition: types.hpp:59
const char * user() const
Get user name.
Definition: changeset.hpp:363
changeset_id_type id() const noexcept
Get ID of this changeset.
Definition: changeset.hpp:197
item_size_type padded_size() const
Definition: item.hpp:165
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:324
num_comments_type m_num_comments
Definition: changeset.hpp:157
constexpr std::size_t padded_length(std::size_t length) noexcept
Definition: item.hpp:64
const_iterator begin() const
Definition: changeset.hpp:414
Definition: osm_object_builder.hpp:304
iterator begin()
Definition: changeset.hpp:398
Changeset & set_id(changeset_id_type id) noexcept
Definition: changeset.hpp:207
osmium::Timestamp closed_at() const noexcept
Definition: changeset.hpp:276
int32_t m_padding2
Definition: changeset.hpp:161
static constexpr osmium::item_type itemtype
Definition: changeset.hpp:185
bool operator<(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:447
user_id_type m_uid
Definition: changeset.hpp:158
Namespace for everything in the Osmium library.
Definition: assembler.hpp:73
Changeset & set_uid(const char *uid)
Definition: changeset.hpp:256
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:318
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:313
Definition: collection.hpp:117
const_iterator cend() const
Definition: changeset.hpp:410
int32_t signed_user_id_type
Type for signed OSM user IDs.
Definition: types.hpp:50
osmium::memory::CollectionIterator< const Item > const_iterator
Definition: changeset.hpp:396
Definition: timestamp.hpp:115
const_iterator end() const
Definition: changeset.hpp:418
changeset_id_type m_id
Definition: changeset.hpp:155
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
bool user_is_anonymous() const noexcept
Is this user anonymous?
Definition: changeset.hpp:261
Changeset & set_num_comments(num_comments_type num_comments) noexcept
Set the number of comments in this changeset.
Definition: changeset.hpp:334
osmium::Box m_bounds
Definition: changeset.hpp:152
osmium::Timestamp created_at() const noexcept
Get timestamp when this changeset was created.
Definition: changeset.hpp:266
Changeset()
Definition: changeset.hpp:163
unsigned char * data() const noexcept
Definition: collection.hpp:91
iterator end()
Definition: changeset.hpp:402
bool operator>=(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:459
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:340
bool operator>(const Changeset &lhs, const Changeset &rhs)
Definition: changeset.hpp:451
Collection()
Definition: collection.hpp:134
unsigned char * subitems_position()
Definition: changeset.hpp:175
ChangesetDiscussion & discussion()
Definition: changeset.hpp:422
int32_t do_not_use() const noexcept
Definition: changeset.hpp:192
const unsigned char * subitems_position() const
Definition: changeset.hpp:179
uint32_t size() const noexcept
Definition: builder.hpp:141
Changeset & set_created_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:296
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:358
int16_t m_padding1
Definition: changeset.hpp:160
Changeset & set_closed_at(const osmium::Timestamp ×tamp)
Definition: changeset.hpp:307
Definition: osm_object_builder.hpp:555
bool closed() const noexcept
Is this changeset closed?
Definition: changeset.hpp:286
ChangesetDiscussion()
Definition: changeset.hpp:134
const_iterator cbegin() const
Definition: changeset.hpp:406
static constexpr bool is_compatible_to(osmium::item_type t) noexcept
Definition: changeset.hpp:187
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:440
Changeset & set_id(const char *id)
Definition: changeset.hpp:218
num_changes_type string_to_num_changes(const char *input)
Definition: types_from_string.hpp:175
Changeset & set_uid(user_id_type uid) noexcept
Definition: changeset.hpp:233
const ChangesetDiscussion & discussion() const
Definition: changeset.hpp:426