KURL url("http://www.example.com/path/file.html"); std::string scheme = url.protocol(); std::string host = url.host(); std::string path = url.path(); // scheme = "http" // host = "www.example.com" // path = "/path/file.html"
KURL url("http", "www.example.com", "/path/file.html"); std::string urlString = url.string(); // urlString = "http://www.example.com/path/file.html"The KURL protocol is part of the KDE libraries (KDE Frameworks) and can be found in the KCoreAddons package.