StdInCommand.h
branchv_0
changeset 23 9c38f6458115
parent 21 1f7b203fceab
child 24 c31fdd965028
equal deleted inserted replaced
22:09a5e21b0a8e 23:9c38f6458115
     7 #include <algorithm>
     7 #include <algorithm>
     8 #include <string>
     8 #include <string>
     9 #include <locale>
     9 #include <locale>
    10 
    10 
    11 #include <relpipe/writer/typedefs.h>
    11 #include <relpipe/writer/typedefs.h>
       
    12 #include <relpipe/writer/AttributeMetadata.h>
    12 #include <relpipe/cli/CLI.h>
    13 #include <relpipe/cli/CLI.h>
    13 #include <relpipe/cli/RelpipeCLIException.h>
    14 #include <relpipe/cli/RelpipeCLIException.h>
    14 
    15 
    15 #include "Command.h"
    16 #include "Command.h"
    16 
    17 
    74 		integer_t attributeCount = std::stoul(readNext(input, arguments, i, true)); // TODO: use integer data type's method?
    75 		integer_t attributeCount = std::stoul(readNext(input, arguments, i, true)); // TODO: use integer data type's method?
    75 		boolean_t writeHeader = true; // TODO: add option for header omitting
    76 		boolean_t writeHeader = true; // TODO: add option for header omitting
    76 
    77 
    77 		std::shared_ptr<RelationalWriter> writer(Factory::create(output));
    78 		std::shared_ptr<RelationalWriter> writer(Factory::create(output));
    78 
    79 
    79 		std::vector<std::pair<string_t, TypeId >> attributes(attributeCount);
    80 		std::vector<AttributeMetadata> attributes(attributeCount);
    80 
    81 
    81 		for (size_t j = 0; j < attributeCount; j++) {
    82 		for (size_t j = 0; j < attributeCount; j++) {
    82 			string_t attributeName = readNext(input, arguments, i, true);
    83 			string_t attributeName = readNext(input, arguments, i, true);
    83 			TypeId attributeType = writer->toTypeId(readNext(input, arguments, i, true));
    84 			TypeId attributeType = writer->toTypeId(readNext(input, arguments, i, true));
    84 			attributes[j] = {attributeName, attributeType};
    85 			attributes[j] = {attributeName, attributeType};