diff --git a/DESCRIPTION b/DESCRIPTION index 956813d..fbe2748 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: jsonify Type: Package Title: Convert Between 'R' Objects and Javascript Object Notation (JSON) Version: 1.2.3 -Date: 2024-01-18 +Date: 2024-05-21 Authors@R: c( person("David", "Cooley", ,"dcooley@symbolix.com.au", role = c("aut", "cre")), person("Chris", "Muir", role = "ctb"), @@ -11,8 +11,7 @@ Authors@R: c( Description: Conversions between 'R' objects and Javascript Object Notation (JSON) using the 'rapidjsonr' library . License: MIT + file LICENSE -Depends: R (>= 3.3.0) -SystemRequirements: C++11 +Depends: R (>= 4.0.0) Imports: Rcpp (>= 1.0.10) LinkingTo: @@ -28,3 +27,5 @@ Encoding: UTF-8 URL: https://symbolixau.github.io/jsonify/, https://github.com/SymbolixAU/jsonify BugReports: https://github.com/SymbolixAU/jsonify/issues VignetteBuilder: knitr +remotes: + https://github.com/SymbolixAU/rapidjsonr diff --git a/NEWS.md b/NEWS.md index 26a1e2e..d489893 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ ## v1.2.3 +* removed C++11 System requirement * patch for handling Int64 [issue 81](https://github.com/symbolixAU/jsonify/issues/81) ## v1.2.2 diff --git a/inst/include/jsonify/from_json/from_json.hpp b/inst/include/jsonify/from_json/from_json.hpp index a49b04a..0430551 100644 --- a/inst/include/jsonify/from_json/from_json.hpp +++ b/inst/include/jsonify/from_json/from_json.hpp @@ -2,7 +2,6 @@ #define R_JSONIFY_FROM_JSON_H #include - #include "from_json_utils.hpp" #include "simplify/simplify.hpp" @@ -77,18 +76,19 @@ namespace from_json { Rcpp::CharacterVector names( json_length ); R_xlen_t i = 0; + // removed in 1.2.3 // https://github.com/Tencent/rapidjson/issues/162#issuecomment-341824061 - #if __cplusplus >= 201703L - for ( const auto& [key, value] : json.GetObject() ) { - out[ i ] = parse_json( value, simplify, fill_na ); - names[ i++ ] = std::string( key ); - } - #else + // #if __cplusplus >= 201703L + // for ( const auto& [key, value] : json.GetObject() ) { + // out[ i ] = parse_json( value, simplify, fill_na ); + // names[ i++ ] = std::string( key ); + // } + // #else for ( const auto& key_value : json.GetObject() ) { out[ i ] = parse_json( key_value.value, simplify, fill_na ); names[ i++ ] = std::string( key_value.name.GetString() ); } - #endif + // #endif out.attr("names") = names; return out; } diff --git a/src/Makevars b/src/Makevars index e9668c9..7f94a7d 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,4 +1,2 @@ -CXX_STD = CXX11 - PKG_CXXFLAGS = -I../inst/include/ PKG_CPPFLAGS=-DSTRICT_R_HEADERS \ No newline at end of file diff --git a/src/Makevars.win b/src/Makevars.win index e9668c9..7f94a7d 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,4 +1,2 @@ -CXX_STD = CXX11 - PKG_CXXFLAGS = -I../inst/include/ PKG_CPPFLAGS=-DSTRICT_R_HEADERS \ No newline at end of file diff --git a/tests/testthat/test-from_json.R b/tests/testthat/test-from_json.R index e648dc7..9b9314a 100644 --- a/tests/testthat/test-from_json.R +++ b/tests/testthat/test-from_json.R @@ -19,7 +19,7 @@ test_that("scalar values handled properly", { test_that("Int64 treated as double", { json_str <- '{"value" : 5500000000}' - expect_equal(from_json(json_obj)$value, 5.5e+09) + expect_equal(from_json(json_str)$value, 5.5e+09) }) test_that("vector / array values handled properly", {