diff --git a/r/src/arrow_types.h b/r/src/arrow_types.h index 61c22a1437f1f..6fef7997dbfa7 100644 --- a/r/src/arrow_types.h +++ b/r/src/arrow_types.h @@ -22,13 +22,13 @@ #undef Free #include #include +#include #include #include #include #include #include #include -#include #define STOP_IF_NOT(TEST, MSG) \ do { \ diff --git a/r/src/csv.cpp b/r/src/csv.cpp index e979a36d56cb3..ca293641807e0 100644 --- a/r/src/csv.cpp +++ b/r/src/csv.cpp @@ -20,20 +20,20 @@ using namespace Rcpp; // [[Rcpp::export]] -std::shared_ptr csv___ReadOptions__initialize(List_ options){ - auto res = std::make_shared(arrow::csv::ReadOptions::Defaults()); +std::shared_ptr csv___ReadOptions__initialize(List_ options) { + auto res = + std::make_shared(arrow::csv::ReadOptions::Defaults()); res->use_threads = options["use_threads"]; res->block_size = options["block_size"]; return res; } -inline char get_char(SEXP x){ - return CHAR(STRING_ELT(x, 0))[0]; -} +inline char get_char(SEXP x) { return CHAR(STRING_ELT(x, 0))[0]; } // [[Rcpp::export]] -std::shared_ptr csv___ParseOptions__initialize(List_ options){ - auto res = std::make_shared(arrow::csv::ParseOptions::Defaults()); +std::shared_ptr csv___ParseOptions__initialize(List_ options) { + auto res = + std::make_shared(arrow::csv::ParseOptions::Defaults()); res->delimiter = get_char(options["delimiter"]); res->quoting = options["quoting"]; res->quote_char = get_char(options["quote_char"]); @@ -46,22 +46,31 @@ std::shared_ptr csv___ParseOptions__initialize(List_ o } // [[Rcpp::export]] -std::shared_ptr csv___ConvertOptions__initialize(List_ options){ - auto res = std::make_shared(arrow::csv::ConvertOptions::Defaults()); +std::shared_ptr csv___ConvertOptions__initialize( + List_ options) { + auto res = std::make_shared( + arrow::csv::ConvertOptions::Defaults()); res->check_utf8 = options["check_utf8"]; return res; } // [[Rcpp::export]] -std::shared_ptr csv___TableReader__Make(const std::shared_ptr& input, const std::shared_ptr& read_options, const std::shared_ptr& parse_options, const std::shared_ptr& convert_options){ +std::shared_ptr csv___TableReader__Make( + const std::shared_ptr& input, + const std::shared_ptr& read_options, + const std::shared_ptr& parse_options, + const std::shared_ptr& convert_options) { std::shared_ptr table_reader; - STOP_IF_NOT_OK(arrow::csv::TableReader::Make(arrow::default_memory_pool(), input, *read_options, *parse_options, *convert_options, &table_reader)); + STOP_IF_NOT_OK(arrow::csv::TableReader::Make(arrow::default_memory_pool(), input, + *read_options, *parse_options, + *convert_options, &table_reader)); return table_reader; } // [[Rcpp::export]] -std::shared_ptr csv___TableReader__Read(const std::shared_ptr& table_reader) { - std::shared_ptr table ; +std::shared_ptr csv___TableReader__Read( + const std::shared_ptr& table_reader) { + std::shared_ptr table; STOP_IF_NOT_OK(table_reader->Read(&table)); return table; }