Commit Graph

2 Commits

Author SHA1 Message Date
John Poole
527fbe3413 Extend URL path resolution to handle relative paths
This is implemented using several URL path helper functions.  The
functions aren't strictly necessary, but the functions make it easier
to implement and test the resolution functionality.
2021-09-25 13:52:56 -04:00
John Poole
d3c368458d Add a url class
The url class is a URL parser and container class that makes working
with URLs easier.  In particular, the resolve() function makes working
with base URLs and possibly relative URLs easier.

url instances are meant to be immutable.  If users need to modify a
url instance they can do so by creating a new url instance.  See the
resolve() implementation for a non-trivial example of how to build a
new url instance using existing url instances.

Note that the current implementation is inefficient due to each URL
component requiring its own separate memory allocation.  We should
consider re-writing this to use tstring_view once that branch is
merged into master.
2021-09-25 11:58:31 -04:00