Files
comaps/3party/opening_hours/parse_opening_hours.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

39 lines
894 B
C++

#pragma once
#include "opening_hours.hpp"
#include <string>
#include <boost/spirit/include/qi.hpp>
namespace osmoh
{
template<typename Parser, typename Context>
bool ParseImpl(std::string const & str, Context & context)
{
using boost::spirit::qi::phrase_parse;
using boost::spirit::standard_wide::space;
Parser parser;
#ifndef NDEBUG
boost::spirit::qi::what(parser);
#endif
auto first = begin(str);
auto const last = end(str);
auto parsed = phrase_parse(first, last, parser, space, context);
if (!parsed || first != last)
return false;
return true;
}
bool Parse(std::string const &, TTimespans &);
bool Parse(std::string const &, Weekdays &);
bool Parse(std::string const &, TMonthdayRanges &);
bool Parse(std::string const &, TYearRanges &);
bool Parse(std::string const &, TWeekRanges &);
bool Parse(std::string const &, TRuleSequences &);
} // namespace osmoh