Overpass API regression suite coverage (Nova Scotia) / overpass_api/statements/set_prop.cc
overpass_api/statements/set_prop.cc
232 of 380 instrumented lines run by the suite (61.1%) 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#include "../data/tag_store.h"20#include "../data/utils.h"21#include "set_prop.h"24Set_Prop_Statement::Statement_Maker Set_Prop_Statement::statement_maker;25Set_Prop_Statement::Evaluator_Maker Set_Prop_Statement::evaluator_maker;28Statement* Set_Prop_Statement::Evaluator_Maker::create_evaluator(29 const Token_Node_Ptr& tree_it, Statement::QL_Context tree_context,30 Statement::Factory& stmt_factory, Parsed_Query& global_settings, Error_Output* error_output)470 error_output->add_parse_error("To set a property it must have a name to the left of the equal sign",55163 q error_output->add_parse_error("To set a property it must have a value to the right of the equal sign",740 error_output->add_parse_error("The only allowed special properties are \"id\" and \"geometry\"",1011864118 q Statement* result = new Set_Prop_Statement(tree_it->line_col.first, attributes, global_settings);1051864118 q tree_context == Statement::in_convert ? Statement::elem_eval_possible : Statement::evaluator_expected,110246 q error_output->add_parse_error("Property assignment needs a right-hand-side value", tree_it->line_col.first);116Set_Prop_Statement::Set_Prop_Statement117 (int line_number_, const std::map< std::string, std::string >& input_attributes, Parsed_Query& global_settings)157void Set_Prop_Statement::add_statement(Statement* statement, std::string text)169std::string Set_Prop_Statement::dump_xml(const std::string& indent) const193std::string Set_Prop_Statement::dump_compact_ql(const std::string&) const215Requested_Context Set_Prop_Statement::request_context() const234template< typename Index, typename Maybe_Attic >235void eval_elems(std::set< std::string >& existing_keys, Set_With_Context& input_set,236 const std::map< Index, std::vector< Maybe_Attic > >& elems,237 const std::vector< std::string >& otherwise_set_keys)2390 for (typename std::map< Index, std::vector< Maybe_Attic > >::const_iterator idx_it = elems.begin();2480 for (std::vector< std::pair< std::string, std::string > >::const_iterator it_keys = data.tags->begin();260void eval_elems(std::set< std::string >& existing_keys, Set_With_Context& input_set,261 const std::map< Uint31_Index, std::vector< Derived_Structure > >& elems,262 const std::vector< std::string >& otherwise_set_keys)2640 for (std::map< Uint31_Index, std::vector< Derived_Structure > >::const_iterator idx_it = elems.begin();2700 Element_With_Context< Derived_Skeleton > data = input_set.get_context(idx_it->first, *elem_it);2730 for (std::vector< std::pair< std::string, std::string > >::const_iterator it_keys = data.tags->begin();285Set_Prop_Task* Set_Prop_Statement::get_task(286 Prepare_Task_Context& context, const std::vector< std::string >& otherwise_set_keys)293496109 q return new Set_Prop_Plain_Task(tag_value ? tag_value->get_string_task(context, key) : 0,3130 for (std::set< std::string >::const_iterator it = existing_keys.begin(); it != existing_keys.end(); ++it)321void Set_Prop_Plain_Task::process(Derived_Structure& result, bool& id_set) const341template< typename Object >342void process(const std::string& key, Set_Prop_Task::Mode mode, Eval_Task* rhs,343 const Element_With_Context< Object >& data, const std::vector< std::string >& declared_keys,344 Derived_Structure& result, bool& id_set)3561716716 q for (std::vector< std::pair< std::string, std::string > >::const_iterator it_keys = data.tags->begin();382void Set_Prop_Plain_Task::process(const Element_With_Context< Node_Skeleton >& data,383 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const389void Set_Prop_Plain_Task::process(const Element_With_Context< Attic< Node_Skeleton > >& data,390 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const396void Set_Prop_Plain_Task::process(const Element_With_Context< Way_Skeleton >& data,397 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const403void Set_Prop_Plain_Task::process(const Element_With_Context< Attic< Way_Skeleton > >& data,404 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const410void Set_Prop_Plain_Task::process(const Element_With_Context< Relation_Skeleton >& data,411 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const417void Set_Prop_Plain_Task::process(const Element_With_Context< Attic< Relation_Skeleton > >& data,418 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const424void Set_Prop_Plain_Task::process(const Element_With_Context< Area_Skeleton >& data,425 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const431void Set_Prop_Plain_Task::process(const Element_With_Context< Derived_Skeleton >& data,432 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const438void Set_Prop_Generic_Task::add_key(const std::string& key, Eval_Task* task)445void Set_Prop_Generic_Task::process(Derived_Structure& result, bool& id_set) const452template< typename Object >453void process_generic(const Owning_Array< Eval_Task* >& rhs, const std::vector< std::string >& keys,454 const Element_With_Context< Object >& data, Derived_Structure& result)461void Set_Prop_Generic_Task::process(const Element_With_Context< Node_Skeleton>& data,462 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const468void Set_Prop_Generic_Task::process(const Element_With_Context< Attic< Node_Skeleton > >& data,469 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const475void Set_Prop_Generic_Task::process(const Element_With_Context< Way_Skeleton >& data,476 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const482void Set_Prop_Generic_Task::process(const Element_With_Context< Attic< Way_Skeleton > >& data,483 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const489void Set_Prop_Generic_Task::process(const Element_With_Context< Relation_Skeleton >& data,490 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const496void Set_Prop_Generic_Task::process(const Element_With_Context< Attic< Relation_Skeleton > >& data,497 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const503void Set_Prop_Generic_Task::process(const Element_With_Context< Area_Skeleton >& data,504 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const510void Set_Prop_Generic_Task::process(const Element_With_Context< Derived_Skeleton >& data,511 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const517void Set_Prop_Geometry_Task::process(Derived_Structure& result, bool& id_set) const524void Set_Prop_Geometry_Task::process(const Element_With_Context< Node_Skeleton>& data,525 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const532void Set_Prop_Geometry_Task::process(const Element_With_Context< Attic< Node_Skeleton > >& data,533 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const540void Set_Prop_Geometry_Task::process(const Element_With_Context< Way_Skeleton >& data,541 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const548void Set_Prop_Geometry_Task::process(const Element_With_Context< Attic< Way_Skeleton > >& data,549 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const556void Set_Prop_Geometry_Task::process(const Element_With_Context< Relation_Skeleton >& data,557 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const564void Set_Prop_Geometry_Task::process(const Element_With_Context< Attic< Relation_Skeleton > >& data,565 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const572void Set_Prop_Geometry_Task::process(const Element_With_Context< Area_Skeleton >& data,573 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const580void Set_Prop_Geometry_Task::process(const Element_With_Context< Derived_Skeleton >& data,581 const std::vector< std::string >& declared_keys, Derived_Structure& result, bool& id_set) const