diff --git a/R/lzstringr-package.R b/R/lzstringr-package.R index 0ce1a8e..9dd4d8e 100644 --- a/R/lzstringr-package.R +++ b/R/lzstringr-package.R @@ -19,22 +19,62 @@ safe_decompress <- function(string, f) { chr_result } -#' @export compressToBase64 +#' Compress a string to Base64 +#' +#' This function takes a string as input and returns a compressed version of the string in Base64 format. +#' +#' @param string A character string to be compressed. +#' @return A character string representing the compressed input string in Base64 format. +#' @export +#' @examples +#' \dontrun{ +#' compressToBase64("Hello, world!") +#' } compressToBase64 <- function(string) { safe_compress(string, compressToBase64_) } -#' @export decompressFromBase64 +#' Decompress a string from Base64 +#' +#' This function takes a compressed string in Base64 format as input and returns the decompressed version of the string. +#' +#' @param string A character string in Base64 format to be decompressed. +#' @return A character string representing the decompressed input string. +#' @export +#' @examples +#' \dontrun{ +#' decompressFromBase64(compressed_string) +#' } decompressFromBase64 <- function(string) { safe_decompress(string, decompressFromBase64_) } -#' @export compressToEncodedURIComponent +#' Compress a string to Encoded URI Component +#' +#' This function takes a string as input and returns a compressed version of the string in Encoded URI Component format. +#' +#' @param string A character string to be compressed. +#' @return A character string representing the compressed input string in Encoded URI Component format. +#' @export +#' @examples +#' \dontrun{ +#' compressToEncodedURIComponent("Hello, world!") +#' } compressToEncodedURIComponent <- function(string) { safe_compress(string, compressToEncodedURIComponent_) } -#' @export decompressFromEncodedURIComponent +#' Decompress a string from Encoded URI Component +#' +#' This function takes a compressed string in Encoded URI Component format as input and returns the decompressed version of the string. +#' +#' @param string A character string in Encoded URI Component format to be decompressed. +#' @return A character string representing the decompressed input string. +#' @export +#' @examples +#' \dontrun{ +#' decompressFromEncodedURIComponent(compressed_string) +#' } decompressFromEncodedURIComponent <- function(string) { safe_decompress(string, decompressFromEncodedURIComponent_) } diff --git a/man/compressToBase64.Rd b/man/compressToBase64.Rd new file mode 100644 index 0000000..481d40c --- /dev/null +++ b/man/compressToBase64.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lzstringr-package.R +\name{compressToBase64} +\alias{compressToBase64} +\title{Compress a string to Base64} +\usage{ +compressToBase64(string) +} +\arguments{ +\item{string}{A character string to be compressed.} +} +\value{ +A character string representing the compressed input string in Base64 format. +} +\description{ +This function takes a string as input and returns a compressed version of the string in Base64 format. +} +\examples{ +\dontrun{ +compressToBase64("Hello, world!") +} +} diff --git a/man/compressToEncodedURIComponent.Rd b/man/compressToEncodedURIComponent.Rd new file mode 100644 index 0000000..e1bdc4d --- /dev/null +++ b/man/compressToEncodedURIComponent.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lzstringr-package.R +\name{compressToEncodedURIComponent} +\alias{compressToEncodedURIComponent} +\title{Compress a string to Encoded URI Component} +\usage{ +compressToEncodedURIComponent(string) +} +\arguments{ +\item{string}{A character string to be compressed.} +} +\value{ +A character string representing the compressed input string in Encoded URI Component format. +} +\description{ +This function takes a string as input and returns a compressed version of the string in Encoded URI Component format. +} +\examples{ +\dontrun{ +compressToEncodedURIComponent("Hello, world!") +} +} diff --git a/man/decompressFromBase64.Rd b/man/decompressFromBase64.Rd new file mode 100644 index 0000000..a97d0db --- /dev/null +++ b/man/decompressFromBase64.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lzstringr-package.R +\name{decompressFromBase64} +\alias{decompressFromBase64} +\title{Decompress a string from Base64} +\usage{ +decompressFromBase64(string) +} +\arguments{ +\item{string}{A character string in Base64 format to be decompressed.} +} +\value{ +A character string representing the decompressed input string. +} +\description{ +This function takes a compressed string in Base64 format as input and returns the decompressed version of the string. +} +\examples{ +\dontrun{ +decompressFromBase64(compressed_string) +} +} diff --git a/man/decompressFromEncodedURIComponent.Rd b/man/decompressFromEncodedURIComponent.Rd new file mode 100644 index 0000000..958ece4 --- /dev/null +++ b/man/decompressFromEncodedURIComponent.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lzstringr-package.R +\name{decompressFromEncodedURIComponent} +\alias{decompressFromEncodedURIComponent} +\title{Decompress a string from Encoded URI Component} +\usage{ +decompressFromEncodedURIComponent(string) +} +\arguments{ +\item{string}{A character string in Encoded URI Component format to be decompressed.} +} +\value{ +A character string representing the decompressed input string. +} +\description{ +This function takes a compressed string in Encoded URI Component format as input and returns the decompressed version of the string. +} +\examples{ +\dontrun{ +decompressFromEncodedURIComponent(compressed_string) +} +} diff --git a/src/code.cpp b/src/code.cpp index 4e9c87b..ad2b5f2 100644 --- a/src/code.cpp +++ b/src/code.cpp @@ -1,7 +1,7 @@ #include using namespace cpp11; #include -#include "lz-string.hpp" +#include "lz-string.h" #include #include #include diff --git a/src/lz-string.hpp b/src/lz-string.h similarity index 100% rename from src/lz-string.hpp rename to src/lz-string.h