bool URI::MakeAbsolute(const URI &base_uri) { BMX_CHECK(base_uri.IsAbsolute()); if (IsAbsolute()) return true; URI abs_uri; int result = uriAddBaseUriA(&abs_uri.mUriUri, &mUriUri, &base_uri.mUriUri); if (result) return false; Copy(abs_uri); return true; }
bool URI::MakeRelative(const URI &base_uri) { BMX_CHECK(base_uri.IsAbsolute()); if (IsRelative()) return true; URI rel_uri; int result = uriRemoveBaseUriA(&rel_uri.mUriUri, &mUriUri, &base_uri.mUriUri, 0); if (result) return false; if (!rel_uri.IsRelative()) return false; Copy(rel_uri); return true; }