support signed integers, negative numbers; binary format change: encode numbers as SLEB128 v_0 v0.15
authorFrantišek Kučera <franta-hg@frantovo.cz>
Fri, 13 Dec 2019 22:19:38 +0100
branchv_0
changeset 39 c3672791b2e8
parent 38 4e29bbc0afa5
child 40 33ada8ed2803
support signed integers, negative numbers; binary format change: encode numbers as SLEB128
src/ArgumentsCommand.h
src/StdInCommand.h
--- a/src/ArgumentsCommand.h	Wed Oct 30 16:47:41 2019 +0100
+++ b/src/ArgumentsCommand.h	Fri Dec 13 22:19:38 2019 +0100
@@ -39,7 +39,7 @@
 
 		size_t i = 0;
 		string_t relationName = arguments[i++];
-		integer_t attributeCount = std::stoul(arguments[i++]); // TODO: use integer data type's method?
+		integer_t attributeCount = std::stol(arguments[i++]); // TODO: use integer data type's method? + unsigned type
 		boolean_t writeHeader = true; // TODO: add option for header omitting
 
 		// TODO: check argument count
--- a/src/StdInCommand.h	Wed Oct 30 16:47:41 2019 +0100
+++ b/src/StdInCommand.h	Fri Dec 13 22:19:38 2019 +0100
@@ -88,7 +88,7 @@
 
 		size_t i = 0;
 		string_t relationName = readNext(input, arguments, i, true);
-		integer_t attributeCount = std::stoul(readNext(input, arguments, i, true)); // TODO: use integer data type's method?
+		integer_t attributeCount = std::stol(readNext(input, arguments, i, true)); // TODO: use integer data type's method? + unsigned type
 		boolean_t writeHeader = true; // TODO: add option for header omitting
 
 		std::shared_ptr<RelationalWriter> writer(Factory::create(output));