io: add std::string overload to slurp
This commit is contained in:
parent
a78ed2b879
commit
98732179a7
8
io.cpp
8
io.cpp
@ -70,6 +70,14 @@ util::slurp (const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
std::vector<char>
|
||||||
|
util::slurp (const std::string &path)
|
||||||
|
{
|
||||||
|
return slurp (path.c_str ());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
std::vector<char>
|
std::vector<char>
|
||||||
util::slurp (FILE *stream)
|
util::slurp (FILE *stream)
|
||||||
|
1
io.hpp
1
io.hpp
@ -39,6 +39,7 @@ namespace util {
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
/// Reads an entire file into memory.
|
/// Reads an entire file into memory.
|
||||||
std::vector<char> slurp (const char *path);
|
std::vector<char> slurp (const char *path);
|
||||||
|
std::vector<char> slurp (const std::string &path);
|
||||||
std::vector<char> slurp (FILE *);
|
std::vector<char> slurp (FILE *);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user