#pragma once

#include <vector>
#include <string>

#define SOURCE_FILE         0
#define SOURCE_FOLDER       1

namespace mini
{
    namespace file
    {
        void setconfigfolder(const char *foldername);
        const char *getconfigfolder();

        void setresourcefilename(const char *str);
        void setresourcefolder(const char *str);
        void setsource(const int src);

        FILE *getfilepointer(const char *resourcename, int& filesize, const bool binary=false);
        char *getfilebuffer(const char *resourcename, int& filesize, const bool zero_terminate=false);

        FILE *getfilepointerex(const char *filename, int& filesize, const bool binary=false);
        char *getfilebufferex(const char *filename, int& filesize, const bool zero_terminate=false);

        const char* getconfigvalue(const char *key);
        void setconfigvalue(const char* key, const char* value);

        bool createFolder(const char* name);
        std::vector<std::string> listresourcesdir(const char *folder, const char *extension=NULL);
    }
}
