remove relpipe-in-cli demo v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue, 22 Sep 2020 17:42:19 +0200
branchv_0
changeset 42 09cd32a65709
parent 41 0776c8c94dae
child 43 3c8ea5dcf793
remove relpipe-in-cli demo
src/DemoCommand.h
src/relpipe-in-cli.cpp
--- 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 <http://www.gnu.org/licenses/>.
- */
-#pragma once
-
-#include <cstdlib>
-#include <iostream>
-#include <string>
-#include <vector>
-#include <algorithm>
-
-#include <relpipe/writer/typedefs.h>
-
-#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<relpipe::writer::string_t>& arguments) override {
-		using namespace relpipe::writer;
-		std::shared_ptr<RelationalWriter> 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));
-		}
-	}
-};
-
-}
-}
-}
--- 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);