From 98732179a7780181b38d18b2323f8cf3246ac404 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 7 Oct 2016 18:08:41 +1100 Subject: [PATCH] io: add std::string overload to slurp --- io.cpp | 8 ++++++++ io.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/io.cpp b/io.cpp index 94e9f30a..fcb521f3 100644 --- a/io.cpp +++ b/io.cpp @@ -70,6 +70,14 @@ util::slurp (const char *path) } +//----------------------------------------------------------------------------- +std::vector +util::slurp (const std::string &path) +{ + return slurp (path.c_str ()); +} + + //----------------------------------------------------------------------------- std::vector util::slurp (FILE *stream) diff --git a/io.hpp b/io.hpp index 38d9973d..2c11ca04 100644 --- a/io.hpp +++ b/io.hpp @@ -39,6 +39,7 @@ namespace util { //------------------------------------------------------------------------- /// Reads an entire file into memory. std::vector slurp (const char *path); + std::vector slurp (const std::string &path); std::vector slurp (FILE *);