Skip to content

Commit

Permalink
Refactor three removed dump() calls into stringstream and << use (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored Jul 10, 2024
1 parent 9a1f464 commit 7232318
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cleanup
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

cd src && make -f Makevars clean
(cd src && make -f Makevars clean)
rm -f src/Makevars src/*.o src/*.so config.log config.status inst/tiledb-*.tar.gz src/connection/*.o
rm -rf tiledb.Rcheck autom4te.cache inst/tiledb/ inst/config.log inst/config.status tiledb/ inst/lib/
18 changes: 18 additions & 0 deletions src/libtiledb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,13 @@ bool libtiledb_domain_has_dimension(XPtr<tiledb::Domain> domain, std::string nam
// [[Rcpp::export]]
void libtiledb_domain_dump(XPtr<tiledb::Domain> domain) {
check_xptr_tag<tiledb::Domain>(domain);
#if TILEDB_VERSION >= TileDB_Version(2,25,0)
std::stringstream ss;
ss << *domain;
std::cout << ss.str();
#else
domain->dump();
#endif
}

double _domain_datatype_time_scale_factor(tiledb_datatype_t dtype) {
Expand Down Expand Up @@ -1523,7 +1529,13 @@ bool libtiledb_attribute_is_variable_sized(XPtr<tiledb::Attribute> attr) {
// [[Rcpp::export]]
void libtiledb_attribute_dump(XPtr<tiledb::Attribute> attr) {
check_xptr_tag<tiledb::Attribute>(attr);
#if TILEDB_VERSION >= TileDB_Version(2,25,0)
std::stringstream ss;
ss << *attr;
std::cout << ss.str();
#else
attr->dump();
#endif
}

// [[Rcpp::export]]
Expand Down Expand Up @@ -2040,7 +2052,13 @@ bool libtiledb_array_schema_sparse(XPtr<tiledb::ArraySchema> schema) {
// [[Rcpp::export]]
void libtiledb_array_schema_dump(XPtr<tiledb::ArraySchema> schema) {
check_xptr_tag<tiledb::ArraySchema>(schema);
#if TILEDB_VERSION >= TileDB_Version(2,25,0)
std::stringstream ss;
ss << *schema;
std::cout << ss.str();
#else
schema->dump();
#endif
}

// [[Rcpp::export]]
Expand Down

0 comments on commit 7232318

Please sign in to comment.