diff --git a/DESCRIPTION b/DESCRIPTION index 3453a84..507dc2c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,11 +16,9 @@ LinkingTo: Rcpp Imports: fastmatch, - Rcpp, - utf8, - utils + Rcpp Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 Depends: - R (>= 2.10) + R (>= 4.2) diff --git a/R/get.R b/R/get.R index 7d7ced2..ddeb72a 100644 --- a/R/get.R +++ b/R/get.R @@ -5,7 +5,6 @@ #' ada_get_href("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_href <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_href(url, len) if (isTRUE(decode)) { @@ -21,7 +20,6 @@ ada_get_href <- function(url, decode = TRUE) { #' ada_get_username("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_username <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_username(url, len) if (isTRUE(decode)) { @@ -38,7 +36,6 @@ ada_get_username <- function(url, decode = TRUE) { #' ada_get_password("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_password <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_password(url, len) if (isTRUE(decode)) { @@ -55,7 +52,6 @@ ada_get_password <- function(url, decode = TRUE) { #' ada_get_port("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_port <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_port(url, len) if (isTRUE(decode)) { @@ -72,7 +68,6 @@ ada_get_port <- function(url, decode = TRUE) { #' ada_get_hash("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_hash <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_hash(url, len) if (isTRUE(decode)) { @@ -89,7 +84,6 @@ ada_get_hash <- function(url, decode = TRUE) { #' ada_get_host("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_host <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_host(url, len) if (isTRUE(decode)) { @@ -106,7 +100,6 @@ ada_get_host <- function(url, decode = TRUE) { #' ada_get_hostname("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_hostname <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_hostname(url, len) if (isTRUE(decode)) { @@ -123,7 +116,6 @@ ada_get_hostname <- function(url, decode = TRUE) { #' ada_get_pathname("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_pathname <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_pathname(url, len) if (isTRUE(decode)) { @@ -140,7 +132,6 @@ ada_get_pathname <- function(url, decode = TRUE) { #' ada_get_search("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_search <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_search(url, len) if (isTRUE(decode)) { @@ -157,7 +148,6 @@ ada_get_search <- function(url, decode = TRUE) { #' ada_get_protocol("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_get_protocol <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) len <- vapply(url, function(x) nchar(x, type = "bytes"), integer(1), USE.NAMES = FALSE) out <- Rcpp_ada_get_protocol(url, len) if (isTRUE(decode)) { diff --git a/R/has.R b/R/has.R index 1f44b49..f9296e8 100644 --- a/R/has.R +++ b/R/has.R @@ -5,7 +5,7 @@ #' ada_has_credentials("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_credentials <- function(url) { - Rcpp_ada_has_credentials(utf8::as_utf8(url)) + Rcpp_ada_has_credentials(url) } #' Check if URL has an empty hostname @@ -15,7 +15,7 @@ ada_has_credentials <- function(url) { #' ada_has_empty_hostname("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_empty_hostname <- function(url) { - Rcpp_ada_has_empty_hostname(utf8::as_utf8(url)) + Rcpp_ada_has_empty_hostname(url) } #' Check if URL has a hostname @@ -25,7 +25,7 @@ ada_has_empty_hostname <- function(url) { #' ada_has_hostname("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_hostname <- function(url) { - Rcpp_ada_has_hostname(utf8::as_utf8(url)) + Rcpp_ada_has_hostname(url) } #' Check if URL has a non empty username @@ -35,7 +35,7 @@ ada_has_hostname <- function(url) { #' ada_has_non_empty_username("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_non_empty_username <- function(url) { - Rcpp_ada_has_non_empty_username(utf8::as_utf8(url)) + Rcpp_ada_has_non_empty_username(url) } #' Check if URL has a non empty password @@ -45,7 +45,7 @@ ada_has_non_empty_username <- function(url) { #' ada_has_non_empty_password("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_non_empty_password <- function(url) { - Rcpp_ada_has_non_empty_password(utf8::as_utf8(url)) + Rcpp_ada_has_non_empty_password(url) } #' Check if URL has a port @@ -55,7 +55,7 @@ ada_has_non_empty_password <- function(url) { #' ada_has_port("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_port <- function(url) { - Rcpp_ada_has_port(utf8::as_utf8(url)) + Rcpp_ada_has_port(url) } #' Check if URL has a hash @@ -65,7 +65,7 @@ ada_has_port <- function(url) { #' ada_has_hash("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_hash <- function(url) { - Rcpp_ada_has_hash(utf8::as_utf8(url)) + Rcpp_ada_has_hash(url) } #' Check if URL has a search @@ -75,5 +75,5 @@ ada_has_hash <- function(url) { #' ada_has_search("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_has_search <- function(url) { - Rcpp_ada_has_search(utf8::as_utf8(url)) + Rcpp_ada_has_search(url) } diff --git a/R/parse.R b/R/parse.R index d86e64d..b373d3e 100644 --- a/R/parse.R +++ b/R/parse.R @@ -6,7 +6,6 @@ #' ada_url_parse("https://user_1:password_1@example.org:8080/dir/../api?q=1#frag") #' @export ada_url_parse <- function(url, decode = TRUE) { - url <- utf8::as_utf8(url) url_parsed <- Rcpp_ada_parse(url) if (isTRUE(decode)) { return(.decoder(url_parsed))