Skip to content

Commit

Permalink
LONG_VECTOR guards
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Mar 14, 2020
1 parent e30f28e commit 3221de8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: jsonify
Type: Package
Title: Convert Between 'R' Objects and Javascript Object Notation (JSON)
Version: 1.1.1
Date: 2020-03-13
Date: 2020-03-14
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre")),
person("Chris", "Muir", role = "ctb")
Expand Down
1 change: 0 additions & 1 deletion inst/include/jsonify/from_json/from_json_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <Rcpp.h>

/* // [[Rcpp::depends(rapidjsonr)]] */
#include "rapidjson/document.h"

#define R_NA_VAL Rcpp::LogicalVector::create(NA_LOGICAL);
Expand Down
25 changes: 22 additions & 3 deletions inst/include/jsonify/to_json/writers/simple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace simple {
}
}

#ifdef LONG_VECTOR_SUPPORT
/*
* for writing a single value of a vector
*/
Expand All @@ -72,6 +73,7 @@ namespace simple {
jsonify::writers::scalars::write_value( writer, s );
}
}
#endif

template< typename Writer>
inline void write_value(
Expand Down Expand Up @@ -147,6 +149,7 @@ namespace simple {
}
}

#ifdef LONG_VECTOR_SUPPORT
/*
* For writing a single value of a vector
*/
Expand Down Expand Up @@ -180,6 +183,7 @@ namespace simple {
}
}
}
#endif

template < typename Writer >
inline void write_value(
Expand Down Expand Up @@ -291,7 +295,7 @@ namespace simple {
}
}


#ifdef LONG_VECTOR_SUPPORT
/*
* For writing a single value of a vector
*/
Expand Down Expand Up @@ -343,6 +347,7 @@ namespace simple {
}
}
}
#endif

template< typename Writer >
inline void write_value(
Expand Down Expand Up @@ -426,6 +431,7 @@ namespace simple {
}
}

#ifdef LONG_VECTOR_SUPPORT

template < typename Writer >
inline void write_value(
Expand All @@ -440,6 +446,7 @@ namespace simple {
jsonify::writers::scalars::write_value( writer, l );
}
}
#endif

template < typename Writer >
inline void write_value(
Expand Down Expand Up @@ -482,6 +489,7 @@ namespace simple {
// ---------------------------------------------------------------------------
// matrix values
// ---------------------------------------------------------------------------
#ifdef LONG_VECTOR_SUPPORT

template < typename Writer >
inline void write_value(
Expand All @@ -496,6 +504,8 @@ namespace simple {
write_value( writer, this_row, unbox, numeric_dates, factors_as_string ); // true, true : numeric_dates, factors_as_string
}

#endif

template < typename Writer >
inline void write_value(
Writer& writer,
Expand Down Expand Up @@ -538,6 +548,8 @@ namespace simple {
jsonify::utils::end_array( writer, will_unbox );
}

#ifdef LONG_VECTOR_SUPPORT

template < typename Writer >
inline void write_value(
Writer& writer,
Expand All @@ -552,6 +564,7 @@ namespace simple {
Rcpp::NumericVector this_row = mat(row, Rcpp::_);
write_value( writer, this_row, unbox, digits, numeric_dates );
}
#endif

template < typename Writer >
inline void write_value(
Expand Down Expand Up @@ -597,7 +610,8 @@ namespace simple {
}
jsonify::utils::end_array( writer, will_unbox );
}


#ifdef LONG_VECTOR_SUPPORT
template < typename Writer >
inline void write_value(
Writer& writer,
Expand All @@ -609,6 +623,7 @@ namespace simple {
Rcpp::StringVector this_row = mat(row, Rcpp::_);
write_value( writer, this_row, unbox );
}
#endif

template < typename Writer >
inline void write_value(
Expand Down Expand Up @@ -650,6 +665,8 @@ namespace simple {
jsonify::utils::end_array( writer, will_unbox );
}

#ifdef LONG_VECTOR_SUPPORT

template < typename Writer >
inline void write_value(
Writer& writer,
Expand All @@ -661,6 +678,7 @@ namespace simple {
Rcpp::LogicalVector this_row = mat( row, Rcpp::_ );
write_value( writer, this_row, unbox );
}
#endif

template < typename Writer >
inline void write_value(
Expand Down Expand Up @@ -705,7 +723,7 @@ namespace simple {
jsonify::utils::end_array( writer, will_unbox );
}

#ifdef LONG_VECTOR_SUPPORT
/*
* template for R SEXPs for single-row from a vector
*/
Expand Down Expand Up @@ -766,6 +784,7 @@ namespace simple {
}
}
}
#endif

/*
* template for R SEXPs for single-row from a vector
Expand Down

0 comments on commit 3221de8

Please sign in to comment.