From 02a04f00e2aee0f87d64a1c4ced3b076ec9b7268 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 23 Nov 2014 20:53:40 +0100 Subject: [PATCH] removed unused files --- src/lib/ebus/Makefile.am | 12 +- src/lib/ebus/test/Makefile.am | 18 +- src/lib/ebus/test/test_commands.cpp | 86 ------- src/lib/ebus/test/test_configfile.cpp | 47 ---- src/lib/ebus/test/test_decode.cpp | 308 ------------------------- src/lib/ebus/test/test_encode.cpp | 309 -------------------------- 6 files changed, 2 insertions(+), 778 deletions(-) delete mode 100644 src/lib/ebus/test/test_commands.cpp delete mode 100644 src/lib/ebus/test/test_configfile.cpp delete mode 100644 src/lib/ebus/test/test_decode.cpp delete mode 100644 src/lib/ebus/test/test_encode.cpp diff --git a/src/lib/ebus/Makefile.am b/src/lib/ebus/Makefile.am index 6f67d137..d8013f01 100644 --- a/src/lib/ebus/Makefile.am +++ b/src/lib/ebus/Makefile.am @@ -13,17 +13,7 @@ libebus_a_SOURCES = result.cpp \ port.cpp \ port.h \ message.cpp \ - message.h \ - command.cpp \ - command.h \ - commands.cpp \ - commands.h \ - configfile.cpp \ - configfile.h \ - decode.cpp \ - decode.h \ - encode.cpp \ - encode.h + message.h distclean-local: -rm -f Makefile.in diff --git a/src/lib/ebus/test/Makefile.am b/src/lib/ebus/test/Makefile.am index 4f76723d..56cdfd8c 100644 --- a/src/lib/ebus/test/Makefile.am +++ b/src/lib/ebus/test/Makefile.am @@ -6,11 +6,7 @@ AM_CXXFLAGS = -fpic \ noinst_PROGRAMS = test_port \ test_symbol \ test_data \ - test_message \ - test_commands \ - test_configfile \ - test_decode \ - test_encode + test_message test_port_SOURCES = test_port.cpp test_port_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a @@ -24,18 +20,6 @@ test_data_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a test_message_SOURCES = test_message.cpp test_message_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a -test_commands_SOURCES = test_commands.cpp -test_commands_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a - -test_configfile_SOURCES = test_configfile.cpp -test_configfile_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a - -test_decode_SOURCES = test_decode.cpp -test_decode_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a - -test_encode_SOURCES = test_encode.cpp -test_encode_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a - distclean-local: -rm -f Makefile.in -rm -rf .libs diff --git a/src/lib/ebus/test/test_commands.cpp b/src/lib/ebus/test/test_commands.cpp deleted file mode 100644 index 6dc0a981..00000000 --- a/src/lib/ebus/test/test_commands.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) Roland Jax 2012-2014 - * - * This file is part of ebusd. - * - * ebusd 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, either version 3 of the License, or - * (at your option) any later version. - * - * ebusd 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 ebusd. If not, see http://www.gnu.org/licenses/. - */ - -#include "configfile.h" -#include "commands.h" -#include -#include -#include -#include -#include - -using namespace std; - -// will be part of cfg csv class -void readCSV(istream& is, Commands& commands){ - string line; - - // read lines - while (getline(is, line) != 0) { - vector row; - string column; - int count; - - count = 0; - - istringstream stream(line); - - // walk through columns - while (getline(stream, column, ';') != 0) { - row.push_back(column); - count++; - } - - commands.addCommand(row); - } -} - -int main() -{ - Commands* commands = ConfigCommands("test", ft_csv).getCommands(); - cout << "Commands: " << commands->sizeCmdDB() << endl; - - //~ string data("g ci password pin1"); - string data("s vwxmk DesiredTemp"); - - int index = commands->findCommand(data); - cout << "found at index: " << index << endl; - - // prepare data - string token; - istringstream stream(data); - vector cmd; - - // split stream - while (getline(stream, token, ' ') != 0) - cmd.push_back(token); - - //~ Command* command = new Command(index, (*commands)[index], "ff15b509030d2c0035000401000000cf00"); - Command* command = new Command(index, (*commands)[index], "19.0"); - - //~ string result = command->calcResult(cmd); - string result = command->calcData(); - cout << "result: " << result << endl; - - delete command; - - return 0; -} - - diff --git a/src/lib/ebus/test/test_configfile.cpp b/src/lib/ebus/test/test_configfile.cpp deleted file mode 100644 index df3d2ce9..00000000 --- a/src/lib/ebus/test/test_configfile.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) Roland Jax 2012-2014 - * - * This file is part of ebusd. - * - * ebusd 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, either version 3 of the License, or - * (at your option) any later version. - * - * ebusd 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 ebusd. If not, see http://www.gnu.org/licenses/. - */ - -#include "configfile.h" -#include -#include -#include -#include -#include - -using namespace std; - -int main() { - - string dir("test"); - ConfigCommands config(dir, ft_csv); - - Commands* commands = config.getCommands(); - - cout << "size: " << commands->sizeCmdDB() << endl; - - commands->findCommand("g ci Password"); - - cout << (*commands)[0][0] << endl; - - delete commands; - - return 0; -} - - diff --git a/src/lib/ebus/test/test_decode.cpp b/src/lib/ebus/test/test_decode.cpp deleted file mode 100644 index 346bda96..00000000 --- a/src/lib/ebus/test/test_decode.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (C) Roland Jax 2012-2014 - * - * This file is part of ebusd. - * - * ebusd 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, either version 3 of the License, or - * (at your option) any later version. - * - * ebusd 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 ebusd. If not, see http://www.gnu.org/licenses/. - */ - -#include "decode.h" -#include -#include - -using namespace std; - -int main() -{ - Decode* help_dec = NULL; - - cout << endl; - - // HEX - { - const char* hex[] = {"53706569636865722020"}; - for (size_t i = 0; i < sizeof(hex)/sizeof(hex[0]); i++) { - help_dec = new DecodeHEX(hex[i]); - cout << "DecodeHEX: " << setw(20) << hex[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // UCH - { - const char* uch[] = {"00", "01", "7f", "80", "fe", "ff", "a1"}; - for (size_t i = 0; i < sizeof(uch)/sizeof(uch[0]); i++) { - help_dec = new DecodeUCH(uch[i], "1.0"); - cout << "DecodeUCH: " << setw(20) << uch[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // SCH - { - const char* sch[] = {"00", "01", "7f", "80", "fe", "ff", "a1"}; - for (size_t i = 0; i < sizeof(sch)/sizeof(sch[0]); i++) { - help_dec = new DecodeSCH(sch[i], "1.0"); - cout << "DecodeSCH: " << setw(20) << sch[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // UIN - { - const char* uin[] = {"0000", "0001", "7fff", "8000", "fffe", "ffff", "a1b2"}; - for (size_t i = 0; i < sizeof(uin)/sizeof(uin[0]); i++) { - help_dec = new DecodeUIN(uin[i], "1.0"); - cout << "DecodeUIN: " << setw(20) << uin[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // SIN - { - const char* sin[] = {"0000", "0001", "7fff", "8000", "fffe", "ffff", "a1b2"}; - for (size_t i = 0; i < sizeof(sin)/sizeof(sin[0]); i++) { - help_dec = new DecodeSIN(sin[i], "1.0"); - cout << "DecodeSIN: " << setw(20) << sin[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // ULG - { - const char* ulg[] = {"00000000", "00000001", "7fffffff", "80000000", "fffffffe", "ffffffff", "a1b2c3d4"}; - for (size_t i = 0; i < sizeof(ulg)/sizeof(ulg[0]); i++) { - help_dec = new DecodeULG(ulg[i], "1.0"); - cout << "DecodeULG: " << setw(20) << ulg[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // SLG - { - const char* slg[] = {"00000000", "00000001", "7fffffff", "80000000", "fffffffe", "ffffffff", "a1b2c3d4"}; - for (size_t i = 0; i < sizeof(slg)/sizeof(slg[0]); i++) { - help_dec = new DecodeSLG(slg[i], "1.0"); - cout << "DecodeSLG: " << setw(20) << slg[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // FLT - { - const char* flt[] = {"0000", "081b", "2532", "2689", "0851"}; - for (size_t i = 0; i < sizeof(flt)/sizeof(flt[0]); i++) { - help_dec = new DecodeFLT(flt[i], "1.0"); - cout << "DecodeFLT: " << setw(20) << flt[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // STR - { - const char* str[] = {"53706569636865722020", "5644363030" }; - for (size_t i = 0; i < sizeof(str)/sizeof(str[0]); i++) { - help_dec = new DecodeSTR(str[i]); - cout << "DecodeSTR: " << setw(20) << str[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // BCD - { - const char* bcd[] = {"00", "01", "02", "03", "12", "99"}; - for (size_t i = 0; i < sizeof(bcd)/sizeof(bcd[0]); i++) { - help_dec = new DecodeBCD(bcd[i], "1.0"); - cout << "DecodeBCD: " << setw(20) << bcd[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // D1B - { - const char* d1b[] = {"00", "01", "7f", "81", "80"}; - for (size_t i = 0; i < sizeof(d1b)/sizeof(d1b[0]); i++) { - help_dec = new DecodeD1B(d1b[i], "1.0"); - cout << "DecodeD1B: " << setw(20) << d1b[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // D1C - { - const char* d1c[] = {"00", "64", "c8"}; - for (size_t i = 0; i < sizeof(d1c)/sizeof(d1c[0]); i++) { - help_dec = new DecodeD1C(d1c[i], "1.0"); - cout << "DecodeD1C: " << setw(20) << d1c[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // D2B - { - const char* d2b[] = {"0000", "0100", "ffff", "00ff", "0080", "0180", "ff7f"}; - for (size_t i = 0; i < sizeof(d2b)/sizeof(d2b[0]); i++) { - help_dec = new DecodeD2B(d2b[i], "1.0"); - cout << "DecodeD2B: " << setw(20) << d2b[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // D2C - { - const char* d2c[] = {"0000", "0100", "ffff", "f0ff", "0080", "0180", "ff7f"}; - for (size_t i = 0; i < sizeof(d2c)/sizeof(d2c[0]); i++) { - help_dec = new DecodeD2C(d2c[i], "1.0"); - cout << "DecodeD2C: " << setw(20) << d2c[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // BDA - { - const char* bda[] = {"171113", "220901"}; - for (size_t i = 0; i < sizeof(bda)/sizeof(bda[0]); i++) { - help_dec = new DecodeBDA(bda[i]); - cout << "DecodeBDA: " << setw(20) << bda[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // HDA - { - const char* hda[] = {"010101", "1f0c1b"}; - for (size_t i = 0; i < sizeof(hda)/sizeof(hda[0]); i++) { - help_dec = new DecodeHDA(hda[i]); - cout << "DecodeHDA: " << setw(20) << hda[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // BTI - { - const char* bti[] = {"010101", "174209", "235959"}; - for (size_t i = 0; i < sizeof(bti)/sizeof(bti[0]); i++) { - help_dec = new DecodeBTI(bti[i]); - cout << "DecodeBTI: " << setw(20) << bti[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // HTI - { - const char* hti[] = {"010101", "112a09", "173b3b"}; - for (size_t i = 0; i < sizeof(hti)/sizeof(hti[0]); i++) { - help_dec = new DecodeHTI(hti[i]); - cout << "DecodeHTI: " << setw(20) << hti[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // BDY - { - const char* bdy[] = {"01", "03", "06", "07"}; - for (size_t i = 0; i < sizeof(bdy)/sizeof(bdy[0]); i++) { - help_dec = new DecodeBDY(bdy[i]); - cout << "DecodeBDY: " << setw(20) << bdy[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // HDY - { - const char* hdy[] = {"01", "03", "07", "08"}; - for (size_t i = 0; i < sizeof(hdy)/sizeof(hdy[0]); i++) { - help_dec = new DecodeHDY(hdy[i]); - cout << "DecodeHDY: " << setw(20) << hdy[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - // TTM - { - const char* ttm[] = {"00", "23", "4f", "90"}; - for (size_t i = 0; i < sizeof(ttm)/sizeof(ttm[0]); i++) { - help_dec = new DecodeTTM(ttm[i]); - cout << "DecodeTTM: " << setw(20) << ttm[i] << " = " << help_dec->decode() << endl; - - delete help_dec; - } - - cout << endl; - } - - return 0; -} - - diff --git a/src/lib/ebus/test/test_encode.cpp b/src/lib/ebus/test/test_encode.cpp deleted file mode 100644 index 3e3bc887..00000000 --- a/src/lib/ebus/test/test_encode.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (C) Roland Jax 2012-2014 - * - * This file is part of ebusd. - * - * ebusd 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, either version 3 of the License, or - * (at your option) any later version. - * - * ebusd 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 ebusd. If not, see http://www.gnu.org/licenses/. - */ - -#include "encode.h" -#include -#include - -using namespace std; - -int main() -{ - Encode* help_enc = NULL; - - cout << endl; - - // HEX - { - const char* hex[] = {"53 70 65 69 63 68 65 72 20 20"}; - for (size_t i = 0; i < sizeof(hex)/sizeof(hex[0]); i++) { - help_enc = new EncodeHEX(hex[i]); - cout << "EncodeHEX: " << setw(20) << hex[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // UCH - { - const char* uch[] = {"0", "1", "127", "128", "254", "255", "161"}; - for (size_t i = 0; i < sizeof(uch)/sizeof(uch[0]); i++) { - help_enc = new EncodeUCH(uch[i], "1.0"); - cout << "EncodeUCH: " << setw(20) << uch[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // SCH - { - const char* sch[] = {"0", "1", "127", "-128", "-2", "-1", "-95"}; - for (size_t i = 0; i < sizeof(sch)/sizeof(sch[0]); i++) { - help_enc = new EncodeSCH(sch[i], "1.0"); - cout << "EncodeSCH: " << setw(20) << sch[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // UIN - { - const char* uin[] = {"0", "1", "32767", "32768", "65534", "65535", "41394"}; - for (size_t i = 0; i < sizeof(uin)/sizeof(uin[0]); i++) { - help_enc = new EncodeUIN(uin[i], "1.0"); - cout << "EncodeUIN: " << setw(20) << uin[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // SIN - { - const char* sin[] = {"0", "1", "32767", "-32768", "-2", "-1", "-24142"}; - for (size_t i = 0; i < sizeof(sin)/sizeof(sin[0]); i++) { - help_enc = new EncodeSIN(sin[i], "1.0"); - cout << "EncodeSIN: " << setw(20) << sin[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // ULG - { - const char* ulg[] = {"0", "1", "2147483647", "2147483648", "4294967294", "4294967295", "2712847316"}; - for (size_t i = 0; i < sizeof(ulg)/sizeof(ulg[0]); i++) { - help_enc = new EncodeULG(ulg[i], "1.0"); - cout << "EncodeULG: " << setw(20) << ulg[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // SLG - { - const char* slg[] = {"0", "1", "2147483647", "-2147483648", "-2", "-1", "-1582119980"}; - for (size_t i = 0; i < sizeof(slg)/sizeof(slg[0]); i++) { - help_enc = new EncodeSLG(slg[i], "1.0"); - cout << "EncodeSLG: " << setw(20) << slg[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // FLT - { - const char* flt[] = {"0.000", "2.075", "9.522", "9.865", "2.129"}; - for (size_t i = 0; i < sizeof(flt)/sizeof(flt[0]); i++) { - help_enc = new EncodeFLT(flt[i], "1.0"); - cout << "EncodeFLT: " << setw(20) << flt[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // STR - { - const char* str[] = {"Speicher ", "VD600" }; - for (size_t i = 0; i < sizeof(str)/sizeof(str[0]); i++) { - help_enc = new EncodeSTR(str[i]); - cout << "EncodeSTR: " << setw(20) << str[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // BCD - { - const char* bcd[] = {"0", "1", "2", "3", "12", "99"}; - for (size_t i = 0; i < sizeof(bcd)/sizeof(bcd[0]); i++) { - help_enc = new EncodeBCD(bcd[i], "1.0"); - cout << "EncodeBCD: " << setw(20) << bcd[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // D1B - { - const char* d1b[] = {"00", "01", "127", "-127", "-128"}; - for (size_t i = 0; i < sizeof(d1b)/sizeof(d1b[0]); i++) { - help_enc = new EncodeD1B(d1b[i], "1.0"); - cout << "EncodeD1B: " << setw(20) << d1b[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // D1C - { - const char* d1c[] = {"0", "50", "100"}; - for (size_t i = 0; i < sizeof(d1c)/sizeof(d1c[0]); i++) { - help_enc = new EncodeD1C(d1c[i], "1.0"); - cout << "EncodeD1C: " << setw(20) << d1c[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // D2B - { - const char* d2b[] = {"0", "0.00390625", "-0.00390625", "-1", "-128", "-127.99609375", "127.99609375"}; - for (size_t i = 0; i < sizeof(d2b)/sizeof(d2b[0]); i++) { - help_enc = new EncodeD2B(d2b[i], "1.0"); - cout << "EncodeD2B: " << setw(20) << d2b[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // D2C - { - const char* d2c[] = {"0", "0.0625", "-0.0625", "-1", "-2048", "-2047.9375", "2047.9375"}; - for (size_t i = 0; i < sizeof(d2c)/sizeof(d2c[0]); i++) { - help_enc = new EncodeD2C(d2c[i], "1.0"); - cout << "EncodeD2C: " << setw(20) << d2c[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // BDA - { - const char* bda[] = {"17.11.2013", "22.09.2001"}; - for (size_t i = 0; i < sizeof(bda)/sizeof(bda[0]); i++) { - help_enc = new EncodeBDA(bda[i]); - cout << "EncodeBDA: " << setw(20) << bda[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // HDA - { - const char* hda[] = {"01.01.2001", "31.12.2027"}; - for (size_t i = 0; i < sizeof(hda)/sizeof(hda[0]); i++) { - help_enc = new EncodeHDA(hda[i]); - cout << "EncodeHDA: " << setw(20) << hda[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // BTI - { - const char* bti[] = {"01:01:01", "17:42:09", "23:59:59"}; - for (size_t i = 0; i < sizeof(bti)/sizeof(bti[0]); i++) { - help_enc = new EncodeBTI(bti[i]); - cout << "EncodeBTI: " << setw(20) << bti[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // HTI - { - const char* hti[] = {"01:01:01", "17:42:09", "23:59:59"}; - for (size_t i = 0; i < sizeof(hti)/sizeof(hti[0]); i++) { - help_enc = new EncodeHTI(hti[i]); - cout << "EncodeHTI: " << setw(20) << hti[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // BDY - { - const char* bdy[] = {"Tue", "Thu", "Sun", "Err"}; - for (size_t i = 0; i < sizeof(bdy)/sizeof(bdy[0]); i++) { - help_enc = new EncodeBDY(bdy[i]); - cout << "EncodeBDY: " << setw(20) << bdy[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - - // HDY - { - const char* hdy[] = {"Mon", "Wed", "Sun", "Err"}; - for (size_t i = 0; i < sizeof(hdy)/sizeof(hdy[0]); i++) { - help_enc = new EncodeHDY(hdy[i]); - cout << "EncodeHDY: " << setw(20) << hdy[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - // TTM - { - const char* ttm[] = {"00:00", "05:50", "13:10", "24:00"}; - for (size_t i = 0; i < sizeof(ttm)/sizeof(ttm[0]); i++) { - help_enc = new EncodeTTM(ttm[i]); - cout << "EncodeTTM: " << setw(20) << ttm[i] << " = " << help_enc->encode() << endl; - - delete help_enc; - } - - cout << endl; - } - - return 0; -} - -