add Path::read()
This commit is contained in:
parent
08979cef45
commit
d54e772803
@ -4,6 +4,7 @@
|
||||
#include "jes/Ref.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace jes
|
||||
{
|
||||
@ -20,6 +21,7 @@ namespace jes
|
||||
const std::string & to_s() { return m_path; }
|
||||
bool exists();
|
||||
std::vector<std::string> dir_entries();
|
||||
bool read(uint8_t ** buf, size_t * size);
|
||||
protected:
|
||||
void clean();
|
||||
std::string m_path;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "jes/Path.h"
|
||||
#include "jes/FileReader.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user