mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
AK: Add URL::to_string() returning a String
For convenience wire up a to_string() method which returns a new String.
This commit is contained in:
parent
b264d29515
commit
c03c0ec900
2 changed files with 6 additions and 0 deletions
|
@ -388,6 +388,11 @@ DeprecatedString URL::serialize_for_display() const
|
||||||
return builder.to_deprecated_string();
|
return builder.to_deprecated_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<String> URL::to_string() const
|
||||||
|
{
|
||||||
|
return String::from_deprecated_string(serialize());
|
||||||
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin
|
// https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin
|
||||||
// https://url.spec.whatwg.org/#concept-url-origin
|
// https://url.spec.whatwg.org/#concept-url-origin
|
||||||
DeprecatedString URL::serialize_origin() const
|
DeprecatedString URL::serialize_origin() const
|
||||||
|
|
1
AK/URL.h
1
AK/URL.h
|
@ -99,6 +99,7 @@ public:
|
||||||
DeprecatedString serialize(ExcludeFragment = ExcludeFragment::No) const;
|
DeprecatedString serialize(ExcludeFragment = ExcludeFragment::No) const;
|
||||||
DeprecatedString serialize_for_display() const;
|
DeprecatedString serialize_for_display() const;
|
||||||
DeprecatedString to_deprecated_string() const { return serialize(); }
|
DeprecatedString to_deprecated_string() const { return serialize(); }
|
||||||
|
ErrorOr<String> to_string() const;
|
||||||
|
|
||||||
// HTML origin
|
// HTML origin
|
||||||
DeprecatedString serialize_origin() const;
|
DeprecatedString serialize_origin() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue