-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate the documentation ref #28
- Loading branch information
1 parent
3bcce4b
commit 7f0f442
Showing
9 changed files
with
63 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,81 +5,68 @@ | |
func(utf8::as_utf8(url)) | ||
} | ||
|
||
#' Check if URL has credentials | ||
#' Check if URL has a certain component | ||
#' | ||
#' These functions check if URL has a certain component. | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @return logical, `NA` if not a valid URL. | ||
#' @examples | ||
#' ada_has_credentials("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' url <- c("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' ada_has_credentials(url) | ||
#' ada_has_empty_hostname(url) | ||
#' ada_has_hostname(url) | ||
#' ada_has_non_empty_username(url) | ||
#' ada_has_hostname(url) | ||
#' ada_has_non_empty_username(url) | ||
#' ada_has_non_empty_password(url) | ||
#' ada_has_port(url) | ||
#' ada_has_hash(url) | ||
#' ada_has_search(url) | ||
#' ## these functions are vectorized | ||
#' urls <- c("http://www.google.com", "http://www.google.com:80", "noturl") | ||
#' ada_has_port(urls) | ||
#' @export | ||
ada_has_credentials <- function(url) { | ||
.has(url, Rcpp_ada_has_credentials) | ||
} | ||
|
||
#' Check if URL has an empty hostname | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_empty_hostname("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_empty_hostname <- function(url) { | ||
.has(url, Rcpp_ada_has_empty_hostname) | ||
} | ||
|
||
#' Check if URL has a hostname | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_hostname("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_hostname <- function(url) { | ||
.has(url, Rcpp_ada_has_hostname) | ||
} | ||
|
||
#' Check if URL has a non empty username | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_non_empty_username("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_non_empty_username <- function(url) { | ||
.has(url, Rcpp_ada_has_non_empty_username) | ||
} | ||
|
||
#' Check if URL has a non empty password | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_non_empty_password("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_non_empty_password <- function(url) { | ||
.has(url, Rcpp_ada_has_non_empty_password) | ||
} | ||
|
||
#' Check if URL has a port | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_port("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_port <- function(url) { | ||
.has(url, Rcpp_ada_has_port) | ||
} | ||
|
||
#' Check if URL has a hash | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_hash("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_hash <- function(url) { | ||
.has(url, Rcpp_ada_has_hash) | ||
} | ||
|
||
#' Check if URL has a search | ||
#' @inheritParams ada_url_parse | ||
#' @return logical | ||
#' @examples | ||
#' ada_has_search("https://user_1:[email protected]:8080/dir/../api?q=1#frag") | ||
#' @rdname ada_has_credentials | ||
#' @export | ||
ada_has_search <- function(url) { | ||
.has(url, Rcpp_ada_has_search) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.