null values: cborType=null, no additional flag needed v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 06 Jun 2021 11:46:26 +0200
branchv_0
changeset 37 cae9eedf4180
parent 36 c97810ccfdef
child 38 ba850b20fe0d
null values: cborType=null, no additional flag needed
src/XMLDocumentConstructor.h
--- a/src/XMLDocumentConstructor.h	Sun Jun 06 11:43:18 2021 +0200
+++ b/src/XMLDocumentConstructor.h	Sun Jun 06 11:46:26 2021 +0200
@@ -82,8 +82,7 @@
 		}
 	}
 
-	void appendScalarValue(Glib::ustring value, Glib::ustring cborType, bool isNull = false) {
-		// TODO: null
+	void appendScalarValue(Glib::ustring value, Glib::ustring cborType) {
 		if (mode.back() == Mode::ARRAY) {
 			xmlpp::Element* element = current->add_child(nameCodec.encode(itemName));
 			element->add_child_text(value);
@@ -225,7 +224,7 @@
 
 		callbacks.null = [](void* context) {
 			CBOR_CALLBACK_START
-			instance->appendScalarValue("", "null", true);
+			instance->appendScalarValue("", "null");
 			CBOR_CALLBACK_END
 		};
 
@@ -257,7 +256,7 @@
 
 		callbacks.undefined = [](void* context) {
 			CBOR_CALLBACK_START
-			instance->appendScalarValue("undefined", "undefined", true); // FIXME: throw exception?
+			instance->appendScalarValue("", "undefined"); // TODO: throw exception?
 			CBOR_CALLBACK_END
 		};