我已經有了一個基本的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