Overpass API regression suite coverage (Saxony) / overpass_api/output_formats/output_json.h

overpass_api/output_formats/output_json.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_JSON_H
20#define DE__OSM3S___OVERPASS_API__OUTPUT_FORMATS__OUTPUT_JSON_H
23#include "../core/datatypes.h"
24#include "../core/geometry.h"
25#include "../frontend/output_handler.h"
27#include <string>
28#include <vector>
31class Output_JSON : public Output_Handler
33public:
3425664 q Output_JSON(const std::string& padding_) : padding(padding_), first_elem(true) {}
36 virtual bool write_http_headers();
37 virtual void write_payload_header(const std::string& db_dir,
38 const std::string& timestamp, const std::string& area_timestamp);
39 virtual void write_footer();
40 virtual void display_remark(const std::string& text);
41 virtual void display_error(const std::string& text);
4355 q virtual void print_global_bbox(const Bbox_Double& bbox) {}
45 virtual void print_item(const Node_Skeleton& skel,
46 const Opaque_Geometry& geometry,
47 const std::vector< std::pair< std::string, std::string > >* tags,
48 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,
49 const std::map< uint32, std::string >* users,
50 Output_Mode mode,
51 const Feature_Action& action = keep,
52 const Node_Skeleton* new_skel = 0,
53 const Opaque_Geometry* new_geometry = 0,
54 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
55 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* new_meta = 0);
57 virtual void print_item(const Way_Skeleton& skel,
58 const Opaque_Geometry& geometry,
59 const std::vector< std::pair< std::string, std::string > >* tags,
60 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,
61 const std::map< uint32, std::string >* users,
62 Output_Mode mode,
63 const Feature_Action& action = keep,
64 const Way_Skeleton* new_skel = 0,
65 const Opaque_Geometry* new_geometry = 0,
66 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
67 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* new_meta = 0);
69 virtual void print_item(const Relation_Skeleton& skel,
70 const Opaque_Geometry& geometry,
71 const std::vector< std::pair< std::string, std::string > >* tags,
72 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,
73 const std::map< uint32, std::string >* roles,
74 const std::map< uint32, std::string >* users,
75 Output_Mode mode,
76 const Feature_Action& action = keep,
77 const Relation_Skeleton* new_skel = 0,
78 const Opaque_Geometry* new_geometry = 0,
79 const std::vector< std::pair< std::string, std::string > >* new_tags = 0,
80 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* new_meta = 0);
82 virtual void print_item(const Derived_Skeleton& skel,
83 const Opaque_Geometry& geometry,
84 const std::vector< std::pair< std::string, std::string > >* tags,
85 Output_Mode mode,
86 const Feature_Action& action = keep);
88private:
89 std::string padding;
90 std::string messages;
91 mutable bool first_elem;
92};
95#endif