Reputation: 645
I have one base URI like https://stackoverflow.com/questions/ask
and a relative URI.
I want to combine them all into one absolute URI.
Examples:
Relative URI: ../
Result: https://stackoverflow.com/questions
Relative URI: /abc/kk?6
Result: https://stackoverflow.com/abc/kk?6
Relative URI: task.php?ui=4
Result: https://stackoverflow.com/questions/task.php?ui=4
How can I do this?
Upvotes: 0
Views: 220
Reputation: 12527
It seems the proposal to add URI-handling to standard C++, https://isocpp.org/files/papers/n3975.html, is dead and/or stuck in committee.
You therefore have to write your own or use a 3rd party - e.g., Qt has QUrl with https://doc.qt.io/qt-5/qurl.html#resolved
QUrl QUrl::resolved(const QUrl &relative) const
Upvotes: 2