author | František Kučera <franta-hg@frantovo.cz> |
Sun, 11 Sep 2016 19:52:26 +0200 | |
changeset 28 | bfef9f34e438 |
parent 20 | 0684883953ba |
permissions | -rw-r--r-- |
franta-hg@28 | 1 |
/** |
franta-hg@28 | 2 |
* parameter-lister |
franta-hg@28 | 3 |
* Copyright © 2015 František Kučera (frantovo.cz) |
franta-hg@28 | 4 |
* |
franta-hg@28 | 5 |
* This program is free software: you can redistribute it and/or modify |
franta-hg@28 | 6 |
* it under the terms of the GNU General Public License as published by |
franta-hg@28 | 7 |
* the Free Software Foundation, either version 3 of the License, or |
franta-hg@28 | 8 |
* (at your option) any later version. |
franta-hg@28 | 9 |
* |
franta-hg@28 | 10 |
* This program is distributed in the hope that it will be useful, |
franta-hg@28 | 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
franta-hg@28 | 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
franta-hg@28 | 13 |
* GNU General Public License for more details. |
franta-hg@28 | 14 |
* |
franta-hg@28 | 15 |
* You should have received a copy of the GNU General Public License |
franta-hg@28 | 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
franta-hg@28 | 17 |
*/ |
franta-hg@7 | 18 |
#include "OutputModule.h" |
franta-hg@11 | 19 |
#include "terminalCodes/TerminalCodes.h" |
franta-hg@7 | 20 |
|
franta-hg@8 | 21 |
namespace info { |
franta-hg@8 | 22 |
namespace globalcode { |
franta-hg@8 | 23 |
namespace parameterLister { |
franta-hg@8 | 24 |
|
franta-hg@19 | 25 |
using namespace std; |
franta-hg@11 | 26 |
|
franta-hg@19 | 27 |
int OutputModule::process(ostream &output, string &command, vector<std::string> &args) { |
franta-hg@11 | 28 |
|
franta-hg@18 | 29 |
for (int i = 0; i < args.size(); i++) { |
franta-hg@18 | 30 |
string s = args[i]; |
franta-hg@20 | 31 |
output << i + 1 << ":" << s.length() << " = \"" << escapeValue(s, true) << "\"" << endl; |
franta-hg@18 | 32 |
} |
franta-hg@14 | 33 |
|
franta-hg@16 | 34 |
return 0; |
franta-hg@8 | 35 |
} |
franta-hg@8 | 36 |
|
franta-hg@20 | 37 |
string OutputModule::escapeValue(string value, bool colorize) { |
franta-hg@20 | 38 |
return value; |
franta-hg@20 | 39 |
} |
franta-hg@9 | 40 |
|
franta-hg@9 | 41 |
} |
franta-hg@9 | 42 |
} |
franta-hg@9 | 43 |
} |
franta-hg@9 | 44 |