Source

pyGAP / game / engine / io / fs / base.cpp

#include "io/file/base.h"
#include "io/fs/base.h"

#include "io/file/stdio.h"


namespace io { namespace fs {


::io::file::Base* Base::open(const char* filename, const char* mode) const {
    ::io::file::Base* file = new ::io::file::Stdio();

    if (file->open(filename, mode))
        return file;

    delete file;
    return NULL;
}


uint8_t* Base::read(const char* filename, const char* mode) const {
    ::io::file::Base* file = open(filename, mode);

    if (!file)
        return NULL;

    uint8_t* buffer = file->read();

    delete file;
    return buffer;
}


uint8_t* Base::read(const uint32_t& h, const char* mode) const {
    return NULL;
}


} /* namespace fs */ } /* namespace io */