diff utilities/vampipe-convert.cpp @ 66:6f160dee1192

Instead of using separate values and b64values entries in JSON serialisations, allow numeric arrays to be replaced by b64 variants wherever they appear (discriminating by type). Also rename values to featureValues in feature throughout, as values turns out to be a hazardous name in a JS context. Finally use Array instead of Text for array encoding (seems clearer).
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 27 Sep 2016 15:04:59 +0100
parents 8a4bcb3dc3a6
children db17657ac875
line wrap: on
line diff
--- a/utilities/vampipe-convert.cpp	Fri Sep 23 14:23:10 2016 +0100
+++ b/utilities/vampipe-convert.cpp	Tue Sep 27 15:04:59 2016 +0100
@@ -96,7 +96,8 @@
     rr.type = VampJson::getRequestResponseType(j, err);
     if (err != "") return {};
     
-    VampJson::BufferSerialisation serialisation = VampJson::BufferSerialisation::Text;
+    VampJson::BufferSerialisation serialisation =
+        VampJson::BufferSerialisation::Array;
 
     switch (rr.type) {
 
@@ -130,7 +131,7 @@
     VampJson::BufferSerialisation serialisation =
         (useBase64 ?
          VampJson::BufferSerialisation::Base64 :
-         VampJson::BufferSerialisation::Text);
+         VampJson::BufferSerialisation::Array);
 
     switch (rr.type) {
 
@@ -176,7 +177,8 @@
     rr.type = VampJson::getRequestResponseType(j, err);
     if (err != "") return {};
     
-    VampJson::BufferSerialisation serialisation = VampJson::BufferSerialisation::Text;
+    VampJson::BufferSerialisation serialisation =
+        VampJson::BufferSerialisation::Array;
 
     rr.success = j["success"].bool_value();
     rr.errorText = j["errorText"].string_value();
@@ -213,7 +215,7 @@
     VampJson::BufferSerialisation serialisation =
         (useBase64 ?
          VampJson::BufferSerialisation::Base64 :
-         VampJson::BufferSerialisation::Text);
+         VampJson::BufferSerialisation::Array);
 
     if (!rr.success) {