Overpass API regression suite coverage (Saxony) / overpass_api/frontend/output_handler.h

overpass_api/frontend/output_handler.h

4 of 5 instrumented lines run by the suite (80.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__FRONTEND__OUTPUT_HANDLER_H
20#define DE__OSM3S___OVERPASS_API__FRONTEND__OUTPUT_HANDLER_H
23#include "../core/datatypes.h"
24#include "../core/geometry.h"
27struct Output_Mode
296522924679 q Output_Mode(unsigned int mode_) : mode(mode_) {}
31 static const unsigned int ID = 0x1;
32 static const unsigned int COORDS = 0x2;
33 static const unsigned int NDS = 0x4;
34 static const unsigned int MEMBERS = 0x8;
35 static const unsigned int TAGS = 0x10;
36 static const unsigned int VERSION = 0x20;
37 static const unsigned int META = 0x40;
38 static const unsigned int GEOMETRY = 0x80;
39 static const unsigned int BOUNDS = 0x100;
40 static const unsigned int CENTER = 0x200;
41 static const unsigned int COUNT = 0x400;
43164204679 q operator unsigned int() const { return mode; }
44 unsigned int mode;
45};
48const std::string& member_type_name(uint32 type);
51class Output_Handler
53public:
54 enum Feature_Action { keep, show_from, show_to, modify, push_away, pull_in, erase, create };
56 // shall return true if it really has written a content declaration
57 virtual bool write_http_headers() = 0;
59 virtual void write_payload_header(const std::string& db_dir,
60 const std::string& timestamp, const std::string& area_timestamp) = 0;
61 virtual void write_footer() = 0;
62 virtual void display_remark(const std::string& text) = 0;
63 virtual void display_error(const std::string& text) = 0;
650 virtual bool supports_diff() const { return false; }
67 virtual void print_global_bbox(const Bbox_Double& bbox) = 0;
69 virtual void print_item(const Node_Skeleton& skel,
70 const Opaque_Geometry& geometry,
71 const std::vector< std::pair< std::string, std::string > >* tags,
72 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,
73 const std::map< uint32, std::string >* users,
74 Output_Mode mode,
75 const Feature_Action& action = keep,
76 const Node_Skeleton* new_skel = 0,
77 const Opaque_Geometry* new_geometry = 0,
78 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
79 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* new_meta = 0) = 0;
81 virtual void print_item(const Way_Skeleton& skel,
82 const Opaque_Geometry& geometry,
83 const std::vector< std::pair< std::string, std::string > >* tags,
84 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,
85 const std::map< uint32, std::string >* users,
86 Output_Mode mode,
87 const Feature_Action& action = keep,
88 const Way_Skeleton* new_skel = 0,
89 const Opaque_Geometry* new_geometry = 0,
90 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
91 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* new_meta = 0) = 0;
93 virtual void print_item(const Relation_Skeleton& skel,
94 const Opaque_Geometry& geometry,
95 const std::vector< std::pair< std::string, std::string > >* tags,
96 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,
97 const std::map< uint32, std::string >* roles,
98 const std::map< uint32, std::string >* users,
99 Output_Mode mode,
100 const Feature_Action& action = keep,
101 const Relation_Skeleton* new_skel = 0,
102 const Opaque_Geometry* new_geometry = 0,
103 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
104 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* new_meta = 0) = 0;
106 virtual void print_item(const Derived_Skeleton& skel,
107 const Opaque_Geometry& geometry,
108 const std::vector< std::pair< std::string, std::string > >* tags,
109 Output_Mode mode,
110 const Feature_Action& action = keep) = 0;
112600100 q virtual std::string dump_config() const { return ""; }
1141079692 q virtual ~Output_Handler() {}
115};
118#endif