Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/overpass_api/statements/id_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Id_Query_Statement : public Output_Statement
static Generic_Statement_Maker< Id_Query_Statement > statement_maker;

virtual Query_Constraint* get_query_constraint();

const std::vector< uint64 >& get_refs() { return refs; }
int get_type() const { return type; }

Expand All @@ -58,14 +58,12 @@ class Id_Query_Statement : public Output_Statement

virtual std::string dump_xml(const std::string& indent) const
{
std::vector< uint64 >::const_iterator it = refs.begin();

std::string result = indent + "<id-query" + std::string(" type=\"") + to_string(type) + "\"";
if (!refs.empty())
result += " ref=\"" + ::to_string(refs[0]) + "\"";
for (uint i = 1; i < refs.size(); ++i)
result += " ref_" + ::to_string(i) + "=\"" + ::to_string(refs[i]) + "\"";

return result + dump_xml_result_name() + "/>\n";
}

Expand All @@ -77,14 +75,14 @@ class Id_Query_Statement : public Output_Statement
virtual std::string dump_ql_in_query(const std::string& indent) const
{
std::vector< uint64 >::const_iterator it = refs.begin();
std::string result = "(";

std::string result = (refs.size() > 1) ? "(id:" : "(";
if (it != refs.end())
result += ::to_string(*it++);
while (it != refs.end())
result += "," + ::to_string(*it++);
result += ")";

return result;
}

Expand Down