Overpass API regression suite coverage (Saxony) / overpass_api/statements/convert.h
overpass_api/statements/convert.h
27 of 39 instrumented lines run by the suite (69.2%) at 8edf11b0419c (this file on GitHub).
runnever runcolumns: line, executions, queries (click for the queries that run the line)
1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.2 *3 * This file is part of Overpass_API.4 *5 * Overpass_API is free software: you can redistribute it and/or modify6 * it under the terms of the GNU Affero General Public License as7 * published by the Free Software Foundation, either version 3 of the8 * License, or (at your option) any later version.9 *10 * Overpass_API is distributed in the hope that it will be useful,11 * but WITHOUT ANY WARRANTY; without even the implied warranty of12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * GNU General Public License for more details.14 *15 * You should have received a copy of the GNU Affero General Public License16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.17 */19#ifndef DE__OSM3S___OVERPASS_API__STATEMENTS__CONVERT_H20#define DE__OSM3S___OVERPASS_API__STATEMENTS__CONVERT_H23#include "set_prop.h"24#include "statement.h"26#include <map>27#include <string>28#include <vector>31class Set_Prop_Statement;34/* === The statement <em>convert</em> ===36The statement <em>convert</em> produces per element in its input set one derived element.37The content of this output element is controlled by the parameters of the statement.39It is necessary to set a fixed type as type for all the generated elements.40After that, an arbitrary number of tags can be set.41In addition, it can be specified to copy all keys from the originating object.42In this case, it is also possible to selectively suppress some tags.44Finally, it is possible to explicitly set the id of the generated objects.45If you do not set an id then an unique id from a global ascending counter is assigned.47The base syntax is49 convert <Type> <List of Tags>51where <List of Tags> is a comma separated list of items,52each of which must be one the following54 <Key> = <Evaluator>55 ::id = <Evaluator>56 :: = <Evaluator>57 !<Key>58*/60class Convert_Statement : public Output_Statement61{62public:63 Convert_Statement(int line_number_, const std::map< std::string, std::string >& attributes,64 Parsed_Query& global_settings);66 virtual void add_statement(Statement* statement, std::string text);67 virtual void execute(Resource_Manager& rman);68 virtual ~Convert_Statement();69 static Generic_Statement_Maker< Convert_Statement > statement_maker;73 virtual std::string dump_xml(const std::string& indent) const820 for (std::vector< Set_Prop_Statement* >::const_iterator it = evaluators.begin(); it != evaluators.end(); ++it)87 virtual std::string dump_compact_ql(const std::string& indent) const102 virtual std::string dump_pretty_ql(const std::string& indent) const117private:118 std::string input;119 std::string type;120 std::vector< Set_Prop_Statement* > evaluators;121 Set_Prop_Statement* geom_evaluator;122 Set_Prop_Statement* id_evaluator;123 Set_Prop_Statement* multi_evaluator;124};127#endif