Overpass API regression suite coverage (Nova Scotia) / overpass_api/output_formats/output_csv.cc
overpass_api/output_formats/output_csv.cc
143 of 167 instrumented lines run by the suite (85.6%) 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 "../../expat/escape_json.h"20#include "output_csv.h"23bool Output_CSV::write_http_headers()30// Escape CSV output according to RFC 418031std::string escape_csv(const std::string& input)59void Output_CSV::write_payload_header60 (const std::string& db_dir, const std::string& timestamp, const std::string& area_timestamp)642525 q for (std::vector< std::pair< std::string, bool > >::const_iterator it = csv_settings.keyfields.begin();76void Output_CSV::write_footer()78 // Intentionally empty82void Output_CSV::display_remark(const std::string& text)84 // Intentionally empty88void Output_CSV::display_error(const std::string& text)90 // Intentionally empty94std::string Output_CSV::dump_config() const9815626 q for (std::vector< std::pair< std::string, bool > >::const_iterator it = csv_settings.keyfields.begin();120template< typename OSM_Element_Metadata_Skeleton >121void print_meta(const std::string& keyfield,122 const OSM_Element_Metadata_Skeleton& meta, const std::map< uint32, std::string >* users)141template< >142void print_meta< int >(const std::string& keyfield,145std::string get_count_tag(const std::vector< std::pair< std::string, std::string> >* tags, std::string tag)148726 q for (std::vector< std::pair< std::string, std::string> >::const_iterator it_tags = tags->begin();156template< typename Id_Type, typename OSM_Element_Metadata_Skeleton >157void process_csv_line(int otype, const std::string& type, Id_Type id, const Opaque_Geometry& geometry,158 const OSM_Element_Metadata_Skeleton* meta,159 const std::vector< std::pair< std::string, std::string> >* tags,160 const std::map< uint32, std::string >* users,161 const Csv_Settings& csv_settings,162 Output_Mode mode)16414616626 q std::vector< std::pair< std::string, bool > >::const_iterator it = csv_settings.keyfields.begin();17172657 q for (std::vector< std::pair< std::string, std::string> >::const_iterator it_tags = tags->begin();19843986 q if ((mode.mode & (Output_Mode::COORDS | Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))20432557 q if ((mode.mode & (Output_Mode::COORDS | Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))231void Output_CSV::print_item(const Node_Skeleton& skel,232 const Opaque_Geometry& geometry,233 const std::vector< std::pair< std::string, std::string > >* tags,234 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,235 const std::map< uint32, std::string >* users,236 Output_Mode mode,237 const Feature_Action& action,238 const Node_Skeleton* new_skel,239 const Opaque_Geometry* new_geometry,240 const std::vector< std::pair< std::string, std::string > >* new_tags,241 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* new_meta)247void Output_CSV::print_item(const Way_Skeleton& skel,248 const Opaque_Geometry& geometry,249 const std::vector< std::pair< std::string, std::string > >* tags,250 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,251 const std::map< uint32, std::string >* users,252 Output_Mode mode,253 const Feature_Action& action,254 const Way_Skeleton* new_skel,255 const Opaque_Geometry* new_geometry,256 const std::vector< std::pair< std::string, std::string > >* new_tags,257 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* new_meta)263void Output_CSV::print_item(const Relation_Skeleton& skel,264 const Opaque_Geometry& geometry,265 const std::vector< std::pair< std::string, std::string > >* tags,266 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,267 const std::map< uint32, std::string >* roles,268 const std::map< uint32, std::string >* users,269 Output_Mode mode,270 const Feature_Action& action,271 const Relation_Skeleton* new_skel,272 const Opaque_Geometry* new_geometry,273 const std::vector< std::pair< std::string, std::string > >* new_tags,274 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* new_meta)27699359 q process_csv_line(3, "relation", skel.id, geometry, meta, tags, users, csv_settings, mode);280void Output_CSV::print_item(const Derived_Skeleton& skel,281 const Opaque_Geometry& geometry,282 const std::vector< std::pair< std::string, std::string > >* tags,283 Output_Mode mode,284 const Feature_Action& action)