Exemplo n.º 1
0
 /**
  * Add role to buffer.
  *
  * @param member Relation member object where the length of the role
  *               will be set.
  * @param role The role.
  * @param length Length of role (without \0 termination).
  * @throws std:length_error If role is longer than osmium::max_osm_string_length
  */
 void add_role(osmium::RelationMember& member, const char* role, const size_t length) {
     if (length > osmium::max_osm_string_length) {
         throw std::length_error("OSM relation member role is too long");
     }
     member.set_role_size(osmium::string_size_type(length) + 1);
     add_size(append(role, osmium::memory::item_size_type(length)) + append_zero());
     add_padding(true);
 }
Exemplo n.º 2
0
 /**
  * Add role to buffer.
  *
  * @param member Relation member object where the length of the role
  *               will be set.
  * @param role The role.
  * @param length Length of role string including \0 termination.
  */
 void add_role(osmium::RelationMember& member, const char* role, const string_size_type length) {
     member.set_role_size(length);
     add_size(append(role, length));
     add_padding(true);
 }