From 24e5e4370b88ac86e83f399d8408ed5d46ac7ac2 Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 28 Feb 2022 23:31:53 +0100 Subject: [PATCH] Removed: duplicate module 'slurp' (use std_utils in libpEpCxx11) --- src/slurp.cc | 21 --------------------- src/slurp.hh | 16 ---------------- 2 files changed, 37 deletions(-) delete mode 100644 src/slurp.cc delete mode 100644 src/slurp.hh diff --git a/src/slurp.cc b/src/slurp.cc deleted file mode 100644 index a1f4436..0000000 --- a/src/slurp.cc +++ /dev/null @@ -1,21 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#include "slurp.hh" -#include -#include -#include - -namespace pEp { - std::string slurp(const std::string& filename) - { - std::ifstream input(filename.c_str(), std::ios_base::binary); - if (!input) { - throw std::runtime_error("Cannot read file \"" + filename + "\"! "); - } - - std::stringstream sstr; - sstr << input.rdbuf(); - return sstr.str(); - } -} // end of namespace pEp diff --git a/src/slurp.hh b/src/slurp.hh deleted file mode 100644 index 66d45c2..0000000 --- a/src/slurp.hh +++ /dev/null @@ -1,16 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#ifndef LIBPEPADAPTER_LIB_SLURP_HH -#define LIBPEPADAPTER_LIB_SLURP_HH - -#include - -namespace pEp { - // reads a whole file and returns it as std::string - // throws std::runtime_error() if the file cannot be read. Empty file is not an error. - std::string slurp(const std::string& filename); - -} // end of namespace pEp - -#endif // LIBPEPADAPTER_LIB_SLURP_HH \ No newline at end of file