Overpass API regression suite coverage (Saxony) / overpass_api/data/regular_expression.h
overpass_api/data/regular_expression.h
29 of 29 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 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___OVERPASS_API__DATA__REGULAR_EXPRESSION_H20#define DE__OSM3S___OVERPASS_API__DATA__REGULAR_EXPRESSION_H22#include "sys/types.h"23#include "locale.h"24#include "regex.h"26#include <iostream>27#include <string>30struct Regular_Expression_Error31{32 public:34 int error_no;35};38class Regular_Expression39{40 public:41 enum Strategy { call_library, match_anything, match_nonempty };43 Regular_Expression(const std::string& regex, bool case_sensitive)52// cache_available = false;53// prev_line = "";54// prev_result = false;66 ~Regular_Expression()72 inline bool matches(const std::string& line) const78// if (is_cache_available && line == prev_line)79// return prev_result;83// is_cache_available = true;84// prev_result = result;85// prev_line = line;90 private:91 Regular_Expression(const Regular_Expression&);92 const Regular_Expression& operator=(const Regular_Expression&);94 regex_t preg;95 Strategy strategy;96// mutable bool cache_available;97// mutable std::string prev_line;98// mutable bool prev_result;99};101#endif