DOMString URI::getAuthority() const { DOMString ret = toStr(authority); if (portSpecified && port>=0) { char buf[7]; snprintf(buf, 6, ":%6d", port); ret.append(buf); } return ret; }
DOMString URI::toString() const { DOMString str = schemeStr; if (!authority.empty()) { str.append("//"); str.append(toStr(authority)); } str.append(toStr(path)); if (!query.empty()) { str.append("?"); str.append(toStr(query)); } if (!fragment.empty()) { str.append("#"); str.append(toStr(fragment)); } return str; }