franta-hg@28: /**
franta-hg@28: * parameter-lister
franta-hg@28: * Copyright © 2015 František Kučera (frantovo.cz)
franta-hg@28: *
franta-hg@28: * This program is free software: you can redistribute it and/or modify
franta-hg@28: * it under the terms of the GNU General Public License as published by
franta-hg@28: * the Free Software Foundation, either version 3 of the License, or
franta-hg@28: * (at your option) any later version.
franta-hg@28: *
franta-hg@28: * This program is distributed in the hope that it will be useful,
franta-hg@28: * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@28: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@28: * GNU General Public License for more details.
franta-hg@28: *
franta-hg@28: * You should have received a copy of the GNU General Public License
franta-hg@28: * along with this program. If not, see .
franta-hg@28: */
franta-hg@7: #ifndef TERMINALOUTPUTMODULE_H
franta-hg@26: #define TERMINALOUTPUTMODULE_H
franta-hg@7:
franta-hg@9: #include
franta-hg@26: #include
franta-hg@9:
franta-hg@10: #include "OutputModule.h"
franta-hg@10:
franta-hg@8: namespace info {
franta-hg@8: namespace globalcode {
franta-hg@8: namespace parameterLister {
franta-hg@8:
franta-hg@26: using namespace std;
franta-hg@26:
franta-hg@10: class TerminalOutputModule : public OutputModule {
franta-hg@7: public:
franta-hg@26: virtual int process(ostream &output, string &command, vector &args);
franta-hg@7: private:
franta-hg@7:
franta-hg@26: const int RED = 31;
franta-hg@26: const int GREEN = 32;
franta-hg@26: const int BLUE = 34;
franta-hg@26:
franta-hg@26: string colorize(int foreground, string text) {
franta-hg@26: //return "\033[" + "32" + "m" + text + "\033[39m";
franta-hg@26: ostringstream fgStream;
franta-hg@26: fgStream << foreground;
franta-hg@26: return "\033[" + fgStream.str() + "m" + text + "\033[39m";
franta-hg@26: }
franta-hg@26:
franta-hg@26: // tabulky: http://www.rubydoc.info/gems/terminal-table/1.4.2/frames
franta-hg@7: };
franta-hg@7:
franta-hg@8: }
franta-hg@8: }
franta-hg@8: }
franta-hg@8:
franta-hg@26: #endif /* TERMINALOUTPUTMODULE_H */
franta-hg@7: