# HG changeset patch # User František Kučera # Date 1532209629 -7200 # Node ID 83dd71fe5cfd8cb03020634b4947484df3217f0b # Parent e615c7d87279892c8bfe1bc40b15b79563642b21 use TypeId enum instead of numeric constants diff -r e615c7d87279 -r 83dd71fe5cfd relpipe-in-cli.cpp --- a/relpipe-in-cli.cpp Sat Jul 21 23:10:42 2018 +0200 +++ b/relpipe-in-cli.cpp Sat Jul 21 23:47:09 2018 +0200 @@ -2,14 +2,16 @@ #include #include +#include int main(int argc, char** argv) { - std::shared_ptr writer(relpipe::writer::RelationalWriter::create(std::cout)); + using namespace relpipe::writer; + std::shared_ptr writer(RelationalWriter::create(std::cout)); writer->startRelation(L"my_first_table",{ - {L"a1", L"string"}, - {L"a2", L"string"}, - {L"a3", L"string"} + {L"a1", TypeId::STRING}, + {L"a2", TypeId::STRING}, + {L"a3", TypeId::STRING} }, true); writer->writeRecord({L"1.1", L"1.2", L"1.3"}); @@ -17,9 +19,9 @@ writer->writeRecord({L"3.1", L"3.2", L"3.3"}); writer->startRelation(L"my_second_table",{ - {L"s", L"string"}, - {L"i", L"integer"}, - {L"b", L"boolean"} + {L"s", TypeId::STRING}, + {L"i", TypeId::INTEGER}, + {L"b", TypeId::BOOLEAN} }, true); writer->writeRecord({L"a", L"1", L"true"});