#ifndef JES_PATH_H
#define JES_PATH_H

#include "jes/Ref.h"
#include <string>
#include <vector>
#include <stdint.h>

namespace jes
{
    class Path;
    typedef Ref<Path> PathRef;
    class Path
    {
    public:
        Path(const char * path);
        Path(const std::string & path);
        PathRef dirname();
        PathRef ext(const std::string & new_ext);
        PathRef join(const Path & other);
        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;
    };
}

#endif
