Skip to content

Commit

Permalink
Merge pull request #34 from schochastics/remove_utf8
Browse files Browse the repository at this point in the history
removed utf8
  • Loading branch information
schochastics authored Sep 25, 2023
2 parents 1b45199 + 1cb2689 commit e956dc5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 0 additions & 10 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#' ada_get_href("https://user_1:[email protected]: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)) {
Expand All @@ -21,7 +20,6 @@ ada_get_href <- function(url, decode = TRUE) {
#' ada_get_username("https://user_1:[email protected]: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)) {
Expand All @@ -38,7 +36,6 @@ ada_get_username <- function(url, decode = TRUE) {
#' ada_get_password("https://user_1:[email protected]: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)) {
Expand All @@ -55,7 +52,6 @@ ada_get_password <- function(url, decode = TRUE) {
#' ada_get_port("https://user_1:[email protected]: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)) {
Expand All @@ -72,7 +68,6 @@ ada_get_port <- function(url, decode = TRUE) {
#' ada_get_hash("https://user_1:[email protected]: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)) {
Expand All @@ -89,7 +84,6 @@ ada_get_hash <- function(url, decode = TRUE) {
#' ada_get_host("https://user_1:[email protected]: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)) {
Expand All @@ -106,7 +100,6 @@ ada_get_host <- function(url, decode = TRUE) {
#' ada_get_hostname("https://user_1:[email protected]: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)) {
Expand All @@ -123,7 +116,6 @@ ada_get_hostname <- function(url, decode = TRUE) {
#' ada_get_pathname("https://user_1:[email protected]: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)) {
Expand All @@ -140,7 +132,6 @@ ada_get_pathname <- function(url, decode = TRUE) {
#' ada_get_search("https://user_1:[email protected]: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)) {
Expand All @@ -157,7 +148,6 @@ ada_get_search <- function(url, decode = TRUE) {
#' ada_get_protocol("https://user_1:[email protected]: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)) {
Expand Down
16 changes: 8 additions & 8 deletions R/has.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' ada_has_credentials("https://user_1:[email protected]: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
Expand All @@ -15,7 +15,7 @@ ada_has_credentials <- function(url) {
#' ada_has_empty_hostname("https://user_1:[email protected]: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
Expand All @@ -25,7 +25,7 @@ ada_has_empty_hostname <- function(url) {
#' ada_has_hostname("https://user_1:[email protected]: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
Expand All @@ -35,7 +35,7 @@ ada_has_hostname <- function(url) {
#' ada_has_non_empty_username("https://user_1:[email protected]: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
Expand All @@ -45,7 +45,7 @@ ada_has_non_empty_username <- function(url) {
#' ada_has_non_empty_password("https://user_1:[email protected]: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
Expand All @@ -55,7 +55,7 @@ ada_has_non_empty_password <- function(url) {
#' ada_has_port("https://user_1:[email protected]: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
Expand All @@ -65,7 +65,7 @@ ada_has_port <- function(url) {
#' ada_has_hash("https://user_1:[email protected]: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
Expand All @@ -75,5 +75,5 @@ ada_has_hash <- function(url) {
#' ada_has_search("https://user_1:[email protected]: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)
}
1 change: 0 additions & 1 deletion R/parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#' ada_url_parse("https://user_1:[email protected]: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))
Expand Down

0 comments on commit e956dc5

Please sign in to comment.