# HG changeset patch # User František Kučera # Date 1600789339 -7200 # Node ID 09cd32a65709dce9654c48236d607221fe11cda1 # Parent 0776c8c94daebf253962e87c47995e5149429d10 remove relpipe-in-cli demo diff -r 0776c8c94dae -r 09cd32a65709 src/DemoCommand.h --- a/src/DemoCommand.h Sat Jun 06 01:50:42 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/** - * Relational pipes - * Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -#include -#include -#include -#include -#include - -#include - -#include "Command.h" - -namespace relpipe { -namespace in { -namespace cli { - -class DemoCommand : public Command { -public: - - void process(std::istream& input, std::ostream& output, const relpipe::writer::string_t& command, const std::vector& arguments) override { - using namespace relpipe::writer; - std::shared_ptr writer(Factory::create(output)); - - - // Various data types passed as strings - writer->startRelation(L"table_from_strings",{ - {L"s", TypeId::STRING}, - {L"i", TypeId::INTEGER}, - {L"b", TypeId::BOOLEAN} - }, true); - - writer->writeAttribute(L"a"); - writer->writeAttribute(L"1"); - writer->writeAttribute(L"true"); - - writer->writeAttribute(L"b"); - writer->writeAttribute(L"2"); - writer->writeAttribute(L"false"); - - - // Various data types passed as raw pointers + typeids - writer->startRelation(L"from_raw_pointers",{ - {L"s", TypeId::STRING}, - {L"i", TypeId::INTEGER}, - {L"b", TypeId::BOOLEAN} - }, true); - - string_t sValue; - integer_t iValue; - boolean_t bValue; - - for (int i = 0; i < 8; i++) { - sValue.append(L"*"); - iValue = i + 1; - bValue = iValue % 2 == 0; - writer->writeAttribute(&sValue, typeid (sValue)); - writer->writeAttribute(&iValue, typeid (iValue)); - writer->writeAttribute(&bValue, typeid (bValue)); - } - } -}; - -} -} -} diff -r 0776c8c94dae -r 09cd32a65709 src/relpipe-in-cli.cpp --- a/src/relpipe-in-cli.cpp Sat Jun 06 01:50:42 2020 +0200 +++ b/src/relpipe-in-cli.cpp Tue Sep 22 17:42:19 2020 +0200 @@ -27,7 +27,6 @@ #include "Command.h" #include "ArgumentsCommand.h" -#include "DemoCommand.h" #include "StdInCommand.h" using namespace relpipe::cli; @@ -37,8 +36,7 @@ Command* findCommand(string_t commandName) { // TODO: better command names // TODO: help command - if (commandName == L"demo") return new DemoCommand(); - else if (commandName == L"generate") return new ArgumentsCommand(); + if (commandName == L"generate") return new ArgumentsCommand(); else if (commandName == L"generate-without-stdin") return new StdInCommand(false); // TODO: just for testing, StdInCommand(false) should work same as ArgumentsCommand() else if (commandName == L"generate-from-stdin") return new StdInCommand(true); else throw RelpipeCLIException(L"Unknown command: " + commandName, CLI::EXIT_CODE_UNKNOWN_COMMAND);