Skip to content

Commit

Permalink
v77 more json fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitre authored Sep 17, 2024
1 parent 7117f0d commit d87bedf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion commandLine/src/defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
#define OFPROJECTGENERATOR_MINOR_VERSION "76"
#define OFPROJECTGENERATOR_MINOR_VERSION "77"
#define OFPROJECTGENERATOR_PATCH_VERSION "0"

#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)
28 changes: 14 additions & 14 deletions commandLine/src/projects/xcodeProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,14 +897,14 @@ bool xcodeProject::saveProjectFile(){
// std::cout << contents.rdbuf() << std::endl;
json j;
try {
j = { json::parse(contents) };
j = json::parse(contents);

// Ugly hack to make nlohmann json work with v 3.11.3
auto dump = j.dump(1, ' ');
if (dump[0] == '[') {
// auto dump = j.dump(1, ' ');
// if (dump[0] == '[') {
// alert("OWWW BUCETA", 31);
j = j[0];
}
// j = j[0];
// }

} catch (json::parse_error & ex) {
ofLogError(xcodeProject::LOG_NAME) << "JSON parse error at byte" << ex.byte;
Expand Down Expand Up @@ -960,21 +960,21 @@ bool xcodeProject::saveProjectFile(){
else {
thispath = thispath.substr(0, thispath.length() -1);
// cout << thispath << endl;
json::json_pointer p { json::json_pointer(thispath) };
json::json_pointer p = json::json_pointer(thispath);
try {
// Fixing XCode one item array issue
// if (!j[p].is_array()) {
if (!j[p].is_array()) {
// cout << endl;
// alert (c, 31);
// cout << "this is not array, creating" << endl;
// cout << thispath << endl;
// auto v { j[p] };
// j[p] = json::array();
// if (!v.is_null()) {
// cout << "thispath" << endl;
// j[p].emplace_back(v);
// }
// }
auto v { j[p] };
j[p] = json::array();
if (!v.is_null()) {
// cout << "thispath " << thispath << endl;
j[p].emplace_back(v);
}
}
// alert (c, 31);
// alert ("emplace back " + cols[3] , 32);
j[p].emplace_back(cols[3]);
Expand Down

0 comments on commit d87bedf

Please sign in to comment.