我已经有了一个基本的URL和一些相关的URI文件,我想拥有绝对路径。绝对URL来自相对路径
E.g.基= https://example.com/some/path.html?query=string和相对URI该文献中:
- 的index.html→https://example.com/some/index.html
- ..→https://example.com/
- ../../../../abc→https://example.com/abc
- ABC/..→https://example.com/some/
- //example.org/→https://example.org/
- ftp://example.net/→ftp://example.net/
在Java中你有class URL实现这个目的:
URL abs = new URL(new URL(basePath), relPath);
但奇怪的是,我不能找到一个纯C库或者功能实现这一点。
是否有图书馆证明该功能?或者更好一些可以使用的小型自包含文件?
检出http://stackoverflow.com/questions/726122/best-ways-of-parsing-a-url-using-c – frankc 2012-01-05 21:51:48