From 4ebd937fe036e5a9427f2bda8683bfca58d5207b Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Fri, 5 Jun 2020 16:47:46 +0200 Subject: [PATCH] deleted old printer file --- datapool/PoolEntry.cpp | 4 +-- globalfunctions/printer.cpp | 61 ------------------------------------- globalfunctions/printer.h | 21 ------------- 3 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 globalfunctions/printer.cpp delete mode 100644 globalfunctions/printer.h diff --git a/datapool/PoolEntry.cpp b/datapool/PoolEntry.cpp index a87a6c4e..d535a72b 100644 --- a/datapool/PoolEntry.cpp +++ b/datapool/PoolEntry.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include template @@ -68,7 +68,7 @@ template void PoolEntry::print() { sif::debug << "Pool Entry Validity: " << (this->valid? " (valid) " : " (invalid) ") << std::endl; - printer::print(reinterpret_cast(address), length); + arrayprinter::print(reinterpret_cast(address), length); sif::debug << std::dec << std::endl; } diff --git a/globalfunctions/printer.cpp b/globalfunctions/printer.cpp deleted file mode 100644 index a68a91ee..00000000 --- a/globalfunctions/printer.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include - -void printer::print(const uint8_t *data, size_t size, OutputType type, - bool printInfo, size_t maxCharPerLine) { - if(printInfo) { - sif::info << "Printing data with size " << size << ": "; - } - sif::info << "["; - if(type == OutputType::HEX) { - printer::printHex(data, size, maxCharPerLine); - } - else if (type == OutputType::DEC) { - printer::printDec(data, size, maxCharPerLine); - } - else if(type == OutputType::BIN) { - printer::printBin(data, size); - } -} - -void printer::printHex(const uint8_t *data, size_t size, - size_t maxCharPerLine) { - sif::info << std::hex; - for(size_t i = 0; i < size; i++) { - sif::info << "0x" << static_cast(data[i]); - if(i < size - 1){ - sif::info << " , "; - if(i > 0 and i % maxCharPerLine == 0) { - sif::info << std::endl; - } - } - - } - sif::info << std::dec; - sif::info << "]" << std::endl; -} - -void printer::printDec(const uint8_t *data, size_t size, - size_t maxCharPerLine) { - sif::info << std::dec; - for(size_t i = 0; i < size; i++) { - sif::info << static_cast(data[i]); - if(i < size - 1){ - sif::info << " , "; - if(i > 0 and i % maxCharPerLine == 0) { - sif::info << std::endl; - } - } - } - sif::info << "]" << std::endl; -} - -void printer::printBin(const uint8_t *data, size_t size) { - sif::info << "\n" << std::flush; - for(size_t i = 0; i < size; i++) { - sif::info << "Byte " << i + 1 << ": 0b"<< - std::bitset<8>(data[i]) << ",\n" << std::flush; - } - sif::info << "]" << std::endl; -} diff --git a/globalfunctions/printer.h b/globalfunctions/printer.h deleted file mode 100644 index 33a382ec..00000000 --- a/globalfunctions/printer.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_ -#define FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_ -#include -#include - -namespace printer { - -enum class OutputType { - DEC, - HEX, - BIN -}; - -void print(const uint8_t* data, size_t size, OutputType type = OutputType::HEX, - bool printInfo = true, size_t maxCharPerLine = 12); -void printHex(const uint8_t* data, size_t size, size_t maxCharPerLine = 12); -void printDec(const uint8_t* data, size_t size, size_t maxCharPerLine = 12); -void printBin(const uint8_t* data, size_t size); -} - -#endif /* FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_ */