diff --git a/src/lib/include/jes/Path.h b/src/lib/include/jes/Path.h index 89b75fc..0b06453 100644 --- a/src/lib/include/jes/Path.h +++ b/src/lib/include/jes/Path.h @@ -4,6 +4,7 @@ #include "jes/Ref.h" #include #include +#include namespace jes { @@ -20,6 +21,7 @@ namespace jes const std::string & to_s() { return m_path; } bool exists(); std::vector dir_entries(); + bool read(uint8_t ** buf, size_t * size); protected: void clean(); std::string m_path; diff --git a/src/lib/src/Path.cc b/src/lib/src/Path.cc index 970f116..2c31ba9 100644 --- a/src/lib/src/Path.cc +++ b/src/lib/src/Path.cc @@ -1,4 +1,5 @@ #include "jes/Path.h" +#include "jes/FileReader.h" #include #include #include @@ -104,6 +105,11 @@ namespace jes return rv; } + bool Path::read(uint8_t ** buf, size_t * size) + { + return FileReader::load(m_path.c_str(), buf, size); + } + void Path::clean() { for (char & c : m_path)