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