Overpass API regression suite coverage (Nova Scotia) / overpass_api/output_formats/output_csv.h

overpass_api/output_formats/output_csv.h

2 of 2 instrumented lines run by the suite (100.0%) 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 modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * 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 of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.
17 */
19#ifndef DE__OSM3S___OVERPASS_API__OUTPUT_FORMATS__OUTPUT_CSV_H
20#define DE__OSM3S___OVERPASS_API__OUTPUT_FORMATS__OUTPUT_CSV_H
23#include "../core/datatypes.h"
24#include "../core/geometry.h"
25#include "../frontend/output_handler.h"
27#include <string>
28#include <vector>
31struct Csv_Settings
33 std::vector< std::pair< std::string, bool > > keyfields;
34 bool with_headerline;
35 std::string separator;
36};
39class Output_CSV : public Output_Handler
41public:
4210426 q Output_CSV(Csv_Settings csv_settings_) : csv_settings(csv_settings_) {}
44 virtual bool write_http_headers();
45 virtual void write_payload_header(const std::string& db_dir,
46 const std::string& timestamp, const std::string& area_timestamp);
47 virtual void write_footer();
48 virtual void display_remark(const std::string& text);
49 virtual void display_error(const std::string& text);
5122 q virtual void print_global_bbox(const Bbox_Double& bbox) {}
53 virtual std::string dump_config() const;
55 virtual void print_item(const Node_Skeleton& skel,
56 const Opaque_Geometry& geometry,
57 const std::vector< std::pair< std::string, std::string > >* tags,
58 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,
59 const std::map< uint32, std::string >* users,
60 Output_Mode mode,
61 const Feature_Action& action = keep,
62 const Node_Skeleton* new_skel = 0,
63 const Opaque_Geometry* new_geometry = 0,
64 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
65 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* new_meta = 0);
67 virtual void print_item(const Way_Skeleton& skel,
68 const Opaque_Geometry& geometry,
69 const std::vector< std::pair< std::string, std::string > >* tags,
70 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,
71 const std::map< uint32, std::string >* users,
72 Output_Mode mode,
73 const Feature_Action& action = keep,
74 const Way_Skeleton* new_skel = 0,
75 const Opaque_Geometry* new_geometry = 0,
76 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
77 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* new_meta = 0);
79 virtual void print_item(const Relation_Skeleton& skel,
80 const Opaque_Geometry& geometry,
81 const std::vector< std::pair< std::string, std::string > >* tags,
82 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,
83 const std::map< uint32, std::string >* roles,
84 const std::map< uint32, std::string >* users,
85 Output_Mode mode,
86 const Feature_Action& action = keep,
87 const Relation_Skeleton* new_skel = 0,
88 const Opaque_Geometry* new_geometry = 0,
89 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
90 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* new_meta = 0);
92 virtual void print_item(const Derived_Skeleton& skel,
93 const Opaque_Geometry& geometry,
94 const std::vector< std::pair< std::string, std::string > >* tags,
95 Output_Mode mode,
96 const Feature_Action& action = keep);
98private:
99 Csv_Settings csv_settings;
100};
103#endif