2016-01-28 10:28:44 -05:00
|
|
|
#ifndef SERVER_URL_PARSER_HPP
|
|
|
|
#define SERVER_URL_PARSER_HPP
|
|
|
|
|
|
|
|
#include "server/api/parsed_url.hpp"
|
|
|
|
|
2024-07-02 16:37:09 -04:00
|
|
|
#include <optional>
|
2016-01-28 10:28:44 -05:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2022-12-11 04:10:26 -05:00
|
|
|
namespace osrm::server::api
|
2016-01-28 10:28:44 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
// Starts parsing and iter and modifies it until iter == end or parsing failed
|
2024-07-02 16:37:09 -04:00
|
|
|
std::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::string::iterator end);
|
2016-04-01 04:53:17 -04:00
|
|
|
|
2024-07-02 16:37:09 -04:00
|
|
|
inline std::optional<ParsedURL> parseURL(std::string url_string)
|
2016-01-28 10:28:44 -05:00
|
|
|
{
|
|
|
|
auto iter = url_string.begin();
|
|
|
|
return parseURL(iter, url_string.end());
|
|
|
|
}
|
2022-12-20 12:00:11 -05:00
|
|
|
} // namespace osrm::server::api
|
2016-01-28 10:28:44 -05:00
|
|
|
|
|
|
|
#endif
|