Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement [ so that it can keep "file" attribute #1

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Suggests:
tidyverse,
testthat (>= 3.0.0),
covr
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
VignetteBuilder: knitr
LinkingTo:
Rcpp, RcppArmadillo
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method("[",t2d_cli)
S3method(c,t2d_opt_LINES)
S3method(cas,default)
S3method(cas,list)
Expand Down
8 changes: 8 additions & 0 deletions R/boundary.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ print.t2d_cli <- function(x, ..., n = 10) {
invisible(x)
}

#' @name cli
#' @export
`[.t2d_cli` <- function(x, ...) {
out <- NextMethod()
attr(out, "file") <- attr(x, "file")
class(out) <- class(x)
out
}

#' Read boundary (*.cli) file
#'
Expand Down
3 changes: 3 additions & 0 deletions man/cli.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// cas_lineadapt
DataFrame cas_lineadapt(DataFrame df, int sep_len);
RcppExport SEXP _telemac_cas_lineadapt(SEXP dfSEXP, SEXP sep_lenSEXP) {
Expand Down