@@ -24,11 +24,11 @@ using result = tl::expected<result_type, ada::errors>;
2424
2525/* *
2626 * The URL parser takes a scalar value string input, with an optional null or
27- * base URL base (default null). The parser assumes the input has an UTF-8
28- * encoding .
27+ * base URL base (default null). The parser assumes the input is a valid ASCII or UTF-8
28+ * string .
2929 *
30- * @param input the string input to analyze.
31- * @param base_url the optional string input to use as a base url.
30+ * @param input the string input to analyze (must be valid ASCII or UTF-8)
31+ * @param base_url the optional URL input to use as a base url.
3232 * @return a parsed URL.
3333 */
3434template <class result_type = ada::url_aggregator>
@@ -41,14 +41,17 @@ extern template ada::result<url_aggregator> parse<url_aggregator>(
4141 std::string_view input, const url_aggregator* base_url);
4242
4343/* *
44+ * Verifies whether the URL strings can be parsed. The function assumes
45+ * that the inputs are valid ASCII or UTF-8 strings.
4446 * @see https://url.spec.whatwg.org/#dom-url-canparse
4547 * @return If URL can be parsed or not.
4648 */
4749bool can_parse (std::string_view input,
4850 const std::string_view* base_input = nullptr );
4951
5052/* *
51- * Computes a href string from a file path.
53+ * Computes a href string from a file path. The function assumes
54+ * that the input is a valid ASCII or UTF-8 string.
5255 * @return a href string (starts with file:://)
5356 */
5457std::string href_from_file (std::string_view path);
0 commit comments