osrm-backend/include/server/api/url_parser.hpp

30 lines
586 B
C++
Raw Normal View History

2016-01-28 10:28:44 -05:00
#ifndef SERVER_URL_PARSER_HPP
#define SERVER_URL_PARSER_HPP
#include "server/api/parsed_url.hpp"
#include <boost/optional.hpp>
#include <string>
namespace osrm
{
namespace server
{
namespace api
{
// Starts parsing and iter and modifies it until iter == end or parsing failed
2016-03-03 08:26:13 -05:00
boost::optional<ParsedURL> parseURL(std::string::iterator &iter, std::string::iterator end);
2016-01-28 10:28:44 -05:00
// copy on purpose because we need mutability
inline boost::optional<ParsedURL> parseURL(std::string url_string)
{
auto iter = url_string.begin();
return parseURL(iter, url_string.end());
}
}
}
}
#endif