Overpass API regression suite coverage (Nova Scotia) / expat/expat_justparse_interface.h
expat/expat_justparse_interface.h
45 of 52 instrumented lines run by the suite (86.5%) 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#ifndef DE__OSM3S___EXPAT__EXPAT_JUSTPARSE_INTERFACE_H20#define DE__OSM3S___EXPAT__EXPAT_JUSTPARSE_INTERFACE_H22#include <string>24#include <string.h>25#include <stdio.h>26#include <time.h>27#include <expat.h>29#ifdef XML_LARGE_SIZE30#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 140031#define XML_FMT_INT_MOD "I64"32#else33#define XML_FMT_INT_MOD "ll"34#endif35#else36#define XML_FMT_INT_MOD "l"37#endif42typedef unsigned int uint;44struct Parse_Error45{47 std::string message;48};50struct Script_Parser51{58 ~Script_Parser()63 void parse(const std::string& input,64 void (*start)(const char*, const char**),65 void (*end)(const char*))92 int current_line_number()100 static void XMLCALL expat_wrapper_start101 (void *data, const char *el, const char **attr)106 static void XMLCALL expat_wrapper_end107 (void *data, const char *el)112 static void XMLCALL expat_wrapper_text113 (void *userData, const XML_Char *s, int len)118 std::string get_parsed_text()123 void reset_parsed_text()128private:129 XML_Parser p;130 bool parser_online;131 std::string result_buf;133 void (*working_start)(const char*, const char**);134 void (*working_end)(const char*);136 //for the XMLParser137 char Buff[BUFFSIZE];138};140void parse(FILE* in,141 void (*start)(const char*, const char**),142 void (*end)(const char*),143 void (*text_handler)(void *data, const XML_Char *s, int len) = 0);145XML_Parser get_current_parser();147#endif