Skip to content

Commit 8eecf7f

Browse files
committed
Rename tag to tag_t
1 parent 547364e commit 8eecf7f

File tree

8 files changed

+59
-59
lines changed

8 files changed

+59
-59
lines changed

middle-pgsql.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void pgsql_parse_tags(const char *string, taglist_t &tags)
266266
string++;
267267
string = decode_upto( string, val );
268268
// String points to the comma or closing '}' */
269-
tags.push_back(tag(key, val));
269+
tags.push_back(tag_t(key, val));
270270
if( *string == ',' )
271271
string++;
272272
}
@@ -730,7 +730,7 @@ void middle_pgsql_t::relations_set(osmid_t id, const memberlist_t &members, cons
730730
util::exit_nicely();
731731
}
732732
sprintf( buf, "%c%" PRIdOSMID, type, it->id );
733-
member_list.push_back(tag(buf, it->role));
733+
member_list.push_back(tag_t(buf, it->role));
734734
}
735735

736736
all_parts.insert(all_parts.end(), node_parts.begin(), node_parts.end());

osmtypes.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ struct member {
4242

4343
typedef std::vector<member> memberlist_t;
4444

45-
struct tag {
45+
struct tag_t {
4646
std::string key;
4747
std::string value;
4848

49-
tag(const std::string &k, const std::string &v) : key(k), value(v) {}
49+
tag_t(const std::string &k, const std::string &v) : key(k), value(v) {}
5050
};
5151

5252

53-
class taglist_t : public std::vector<tag> {
53+
class taglist_t : public std::vector<tag_t> {
5454

55-
typedef std::vector<tag> base_t;
55+
typedef std::vector<tag_t> base_t;
5656

5757
public:
58-
const tag *find(const std::string &key) const { return _find(key); }
58+
const tag_t *find(const std::string &key) const { return _find(key); }
5959

60-
tag *find(const std::string &key) { return const_cast<tag *>(_find(key)); }
60+
tag_t *find(const std::string &key) { return const_cast<tag_t *>(_find(key)); }
6161

6262
int indexof(const std::string &key) const
6363
{
@@ -93,7 +93,7 @@ class taglist_t : public std::vector<tag> {
9393
return defval;
9494
}
9595

96-
void push_dedupe(const tag& t)
96+
void push_dedupe(const tag_t& t)
9797
{
9898
if (find(t.key) == 0)
9999
push_back(t);
@@ -102,7 +102,7 @@ class taglist_t : public std::vector<tag> {
102102
bool contains(const std::string &key) const { return _find(key) != 0; }
103103

104104
private:
105-
const tag *_find(const std::string &key) const
105+
const tag_t *_find(const std::string &key) const
106106
{
107107
for (base_t::const_iterator it = begin() ; it != end(); ++it)
108108
if (it->key == key)

output-gazetteer.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void place_tag_processor::clear()
5959

6060
struct UnnamedPredicate
6161
{
62-
bool operator()(const tag &val) const {
62+
bool operator()(const tag_t &val) const {
6363
return val.key == "natural" ||
6464
val.key == "railway" ||
6565
val.key == "waterway" ||
@@ -83,9 +83,9 @@ void place_tag_processor::process_tags(const taglist_t &tags)
8383
bool placeadmin = false;
8484
bool placehouse = false;
8585
bool placebuilding = false;
86-
const tag *place = 0;
87-
const tag *junction = 0;
88-
const tag *landuse = 0;
86+
const tag_t *place = 0;
87+
const tag_t *junction = 0;
88+
const tag_t *landuse = 0;
8989
bool isnamed = false;
9090
bool isinterpolation = false;
9191
const std::string *house_nr = 0;
@@ -326,7 +326,7 @@ void place_tag_processor::process_tags(const taglist_t &tags)
326326
}
327327

328328
if (isinterpolation)
329-
places.push_back(tag("place", "houses"));
329+
places.push_back(tag_t("place", "houses"));
330330

331331
if (place) {
332332
if (isinterpolation ||
@@ -347,11 +347,11 @@ void place_tag_processor::process_tags(const taglist_t &tags)
347347

348348
if (places.empty()) {
349349
if (placebuilding && (!names.empty() || placehouse || postcode)) {
350-
places.push_back(tag("building", "yes"));
350+
places.push_back(tag_t("building", "yes"));
351351
} else if (placehouse) {
352-
places.push_back(tag("place", "house"));
352+
places.push_back(tag_t("place", "house"));
353353
} else if (postcode) {
354-
places.push_back(tag("place", "postcode"));
354+
places.push_back(tag_t("place", "postcode"));
355355
}
356356
}
357357

@@ -380,7 +380,7 @@ void place_tag_processor::copy_out(char osm_type, osmid_t osm_id,
380380
const std::string &wkt,
381381
std::string &buffer)
382382
{
383-
for (const tag &place: places) {
383+
for (const tag_t &place: places) {
384384
std::string name;
385385
if (place.key == "bridge" || place.key == "tunnel") {
386386
name = domain_name(place.key);
@@ -410,7 +410,7 @@ void place_tag_processor::copy_out(char osm_type, osmid_t osm_id,
410410
bool shop = (place.key == "shop") ||
411411
(place.key == "amenity") ||
412412
(place.key == "tourism");
413-
for (const tag *entry: names) {
413+
for (const tag_t *entry: names) {
414414
if (!shop && (entry->key == "operator"))
415415
continue;
416416

@@ -439,7 +439,7 @@ void place_tag_processor::copy_out(char osm_type, osmid_t osm_id,
439439
copy_opt_string(addr_place, buffer);
440440
// isin
441441
if (!address.empty()) {
442-
for (const tag *entry: address) {
442+
for (const tag_t *entry: address) {
443443
if (entry->key == "tiger:county") {
444444
escape(std::string(entry->value, 0, entry->value.find(",")),
445445
buffer);
@@ -461,7 +461,7 @@ void place_tag_processor::copy_out(char osm_type, osmid_t osm_id,
461461
buffer += "\\N\t";
462462
} else {
463463
bool first = true;
464-
for (const tag *entry: extratags) {
464+
for (const tag_t *entry: extratags) {
465465
if (first)
466466
first = false;
467467
else

output-gazetteer.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class place_tag_processor
3636

3737
bool has_place(const std::string &cls)
3838
{
39-
for (const tag &item: places) {
39+
for (const auto& item: places) {
4040
if (cls == item.key)
4141
return true;
4242
}
@@ -105,10 +105,10 @@ class place_tag_processor
105105
}
106106

107107

108-
std::vector<tag> places;
109-
std::vector<const tag *> names;
110-
std::vector<const tag *> extratags;
111-
std::vector<const tag *> address;
108+
std::vector<tag_t> places;
109+
std::vector<const tag_t *> names;
110+
std::vector<const tag_t *> extratags;
111+
std::vector<const tag_t *> address;
112112
const taglist_t *src;
113113
int admin_level;
114114
const std::string *countrycode;

output-pgsql.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int output_pgsql_t::pgsql_out_way(osmid_t id, const taglist_t &tags, const nodel
123123
else
124124
split_at = 100 * 1000;
125125

126-
tag *areatag = 0;
126+
tag_t *areatag = 0;
127127
geometry_builder::maybe_wkts_t wkts = builder.get_wkt_split(nodes, polygon, split_at);
128128
for (const auto& wkt: *wkts) {
129129
/* FIXME: there should be a better way to detect polygons */
@@ -133,7 +133,7 @@ int output_pgsql_t::pgsql_out_way(osmid_t id, const taglist_t &tags, const nodel
133133
char tmp[32];
134134
snprintf(tmp, sizeof(tmp), "%g", wkt.area);
135135
if (!areatag) {
136-
outtags.push_dedupe(tag("way_area", tmp));
136+
outtags.push_dedupe(tag_t("way_area", tmp));
137137
areatag = outtags.find("way_area");
138138
} else
139139
areatag->value = tmp;
@@ -187,7 +187,7 @@ int output_pgsql_t::pgsql_out_relation(osmid_t id, const taglist_t &rel_tags,
187187
return 0;
188188
}
189189

190-
tag *areatag = 0;
190+
tag_t *areatag = 0;
191191
for (const auto& wkt: *wkts) {
192192
expire->from_wkt(wkt.geom.c_str(), -id);
193193
/* FIXME: there should be a better way to detect polygons */
@@ -196,7 +196,7 @@ int output_pgsql_t::pgsql_out_relation(osmid_t id, const taglist_t &rel_tags,
196196
char tmp[32];
197197
snprintf(tmp, sizeof(tmp), "%g", wkt.area);
198198
if (!areatag) {
199-
outtags.push_dedupe(tag("way_area", tmp));
199+
outtags.push_dedupe(tag_t("way_area", tmp));
200200
areatag = outtags.find("way_area");
201201
} else
202202
areatag->value = tmp;
@@ -228,15 +228,15 @@ int output_pgsql_t::pgsql_out_relation(osmid_t id, const taglist_t &rel_tags,
228228
// If we are making a boundary then also try adding any relations which form complete rings
229229
// The linear variants will have already been processed above
230230
if (make_boundary) {
231-
tag *areatag = 0;
231+
tag_t *areatag = 0;
232232
wkts = builder.build_polygons(xnodes, m_options.enable_multi, id);
233233
for (const auto& wkt: *wkts) {
234234
expire->from_wkt(wkt.geom.c_str(), -id);
235235
if ((wkt.area > 0.0) && m_enable_way_area) {
236236
char tmp[32];
237237
snprintf(tmp, sizeof(tmp), "%g", wkt.area);
238238
if (!areatag) {
239-
outtags.push_dedupe(tag("way_area", tmp));
239+
outtags.push_dedupe(tag_t("way_area", tmp));
240240
areatag = outtags.find("way_area");
241241
} else
242242
areatag->value = tmp;

parse-o5m.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,18 +781,18 @@ void parse_o5m_t::stream_file(const std::string &filename, osmdata_t *osmdata) {
781781

782782
hisver= pbf_uint32(&bufp);
783783
uint32toa(hisver,tmpstr);
784-
tags.push_back(tag("osm_version",tmpstr));
784+
tags.push_back(tag_t("osm_version",tmpstr));
785785
if(hisver!=0) { /* history information available */
786786
histime= o5histime+= pbf_sint64(&bufp);
787787
createtimestamp(histime,tmpstr);
788-
tags.push_back(tag("osm_timestamp",tmpstr));
788+
tags.push_back(tag_t("osm_timestamp",tmpstr));
789789
if(histime!=0) {
790790
o5hiscset+= pbf_sint32(&bufp); /* (not used) */
791791
str_read(&bufp,&sp,&hisuser);
792792
hisuid= pbf_uint64((byte**)&sp);
793793
uint32toa(hisuid,tmpstr);
794-
tags.push_back(tag("osm_uid",tmpstr));
795-
tags.push_back(tag("osm_user",hisuser));
794+
tags.push_back(tag_t("osm_uid",tmpstr));
795+
tags.push_back(tag_t("osm_user",hisuser));
796796
}
797797
} /* end history information available */
798798
} /* end read history */
@@ -888,7 +888,7 @@ void parse_o5m_t::stream_file(const std::string &filename, osmdata_t *osmdata) {
888888
/* replace all blanks in key by underlines */
889889
p++;
890890
}
891-
tags.push_back(tag(k,v));
891+
tags.push_back(tag_t(k,v));
892892
} /* end for all tags of this object */
893893

894894
/* write object into database */

table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void table_t::write_tags_column(const taglist_t &tags, std::string& values,
378378
bool added = false;
379379
for (size_t i = 0; i < tags.size(); ++i)
380380
{
381-
const tag& xtag = tags[i];
381+
const tag_t& xtag = tags[i];
382382
//skip z_order tag and keys which have their own column
383383
if (used[i] || ("z_order" == xtag.key))
384384
continue;

tagtransform.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void add_z_order(taglist_t &tags, int *roads)
9898

9999
char z[13];
100100
snprintf(z, sizeof(z), "%d", z_order);
101-
tags.push_back(tag("z_order", z));
101+
tags.push_back(tag_t("z_order", z));
102102
}
103103

104104
unsigned int c_filter_rel_member_tags(const taglist_t &rel_tags,
@@ -128,7 +128,7 @@ unsigned int c_filter_rel_member_tags(const taglist_t &rel_tags,
128128
for (const auto& rel_tag: rel_tags) {
129129
//copy the name tag as "route_name"
130130
if (is_route && (rel_tag.key == "name"))
131-
out_tags.push_dedupe(tag("route_name", rel_tag.value));
131+
out_tags.push_dedupe(tag_t("route_name", rel_tag.value));
132132
//copy all other tags except for "type"
133133
if (rel_tag.key != "type")
134134
out_tags.push_dedupe(rel_tag);
@@ -149,22 +149,22 @@ unsigned int c_filter_rel_member_tags(const taglist_t &rel_tags,
149149
}
150150
if (*netw == "lcn") {
151151
networknr = 10;
152-
out_tags.push_dedupe(tag("lcn", statetype));
152+
out_tags.push_dedupe(tag_t("lcn", statetype));
153153
} else if (*netw == "rcn") {
154154
networknr = 11;
155-
out_tags.push_dedupe(tag("rcn", statetype));
155+
out_tags.push_dedupe(tag_t("rcn", statetype));
156156
} else if (*netw == "ncn") {
157157
networknr = 12;
158-
out_tags.push_dedupe(tag("ncn", statetype));
158+
out_tags.push_dedupe(tag_t("ncn", statetype));
159159
} else if (*netw == "lwn") {
160160
networknr = 20;
161-
out_tags.push_dedupe(tag("lwn", statetype));
161+
out_tags.push_dedupe(tag_t("lwn", statetype));
162162
} else if (*netw == "rwn") {
163163
networknr = 21;
164-
out_tags.push_dedupe(tag("rwn", statetype));
164+
out_tags.push_dedupe(tag_t("rwn", statetype));
165165
} else if (*netw == "nwn") {
166166
networknr = 22;
167-
out_tags.push_dedupe(tag("nwn", statetype));
167+
out_tags.push_dedupe(tag_t("nwn", statetype));
168168
}
169169
}
170170

@@ -173,28 +173,28 @@ unsigned int c_filter_rel_member_tags(const taglist_t &rel_tags,
173173
if ((*prefcol)[0] == '0' || (*prefcol)[0] == '1'
174174
|| (*prefcol)[0] == '2' || (*prefcol)[0] == '3'
175175
|| (*prefcol)[0] == '4') {
176-
out_tags.push_dedupe(tag("route_pref_color", *prefcol));
176+
out_tags.push_dedupe(tag_t("route_pref_color", *prefcol));
177177
} else {
178-
out_tags.push_dedupe(tag("route_pref_color", "0"));
178+
out_tags.push_dedupe(tag_t("route_pref_color", "0"));
179179
}
180180
} else {
181-
out_tags.push_dedupe(tag("route_pref_color", "0"));
181+
out_tags.push_dedupe(tag_t("route_pref_color", "0"));
182182
}
183183

184184
const std::string *relref = rel_tags.get("ref");
185185
if (relref != NULL ) {
186186
if (networknr == 10) {
187-
out_tags.push_dedupe(tag("lcn_ref", *relref));
187+
out_tags.push_dedupe(tag_t("lcn_ref", *relref));
188188
} else if (networknr == 11) {
189-
out_tags.push_dedupe(tag("rcn_ref", *relref));
189+
out_tags.push_dedupe(tag_t("rcn_ref", *relref));
190190
} else if (networknr == 12) {
191-
out_tags.push_dedupe(tag("ncn_ref", *relref));
191+
out_tags.push_dedupe(tag_t("ncn_ref", *relref));
192192
} else if (networknr == 20) {
193-
out_tags.push_dedupe(tag("lwn_ref", *relref));
193+
out_tags.push_dedupe(tag_t("lwn_ref", *relref));
194194
} else if (networknr == 21) {
195-
out_tags.push_dedupe(tag("rwn_ref", *relref));
195+
out_tags.push_dedupe(tag_t("rwn_ref", *relref));
196196
} else if (networknr == 22) {
197-
out_tags.push_dedupe(tag("nwn_ref", *relref));
197+
out_tags.push_dedupe(tag_t("nwn_ref", *relref));
198198
}
199199
}
200200
} else if (is_boundary) {
@@ -388,7 +388,7 @@ unsigned tagtransform::lua_filter_rel_member_tags(const taglist_t &rel_tags,
388388
while (lua_next(L,-2) != 0) {
389389
const char *key = lua_tostring(L,-2);
390390
const char *value = lua_tostring(L,-1);
391-
out_tags.push_back(tag(key, value));
391+
out_tags.push_back(tag_t(key, value));
392392
lua_pop(L,1);
393393
}
394394
lua_pop(L,1);
@@ -545,7 +545,7 @@ unsigned tagtransform::lua_filter_basic_tags(OsmType type, const taglist_t &tags
545545
while (lua_next(L,-2) != 0) {
546546
const char *key = lua_tostring(L,-2);
547547
const char *value = lua_tostring(L,-1);
548-
out_tags.push_back(tag(key, value));
548+
out_tags.push_back(tag_t(key, value));
549549
lua_pop(L,1);
550550
}
551551

@@ -658,7 +658,7 @@ unsigned int tagtransform::c_filter_basic_tags(OsmType type, const taglist_t &ta
658658
if (polygon) {
659659
if (add_area_tag) {
660660
/* If we need to force this as a polygon, append an area tag */
661-
out_tags.push_dedupe(tag("area", "yes"));
661+
out_tags.push_dedupe(tag_t("area", "yes"));
662662
*polygon = 1;
663663
} else {
664664
*polygon = tags.get_bool("area", flags & FLAG_POLYGON);

0 commit comments

Comments
 (0)