mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 23:22:25 +01:00
byuu says: Basically just a project rename, with s/bsnes/higan and the new icon from lowkee added in. It won't compile on Windows because I forgot to update the resource.rc file, and a path transform command isn't working on Windows. It was really just meant as a starting point, so that v091 WIPs can flow starting from .00 with the new name (it overshadows bsnes v091, so publicly speaking this "shouldn't exist" and will probably be deleted from Google Code when v092 is ready.)
39 lines
722 B
C++
Executable File
39 lines
722 B
C++
Executable File
#ifndef NALL_STREAM_ZIP_HPP
|
|
#define NALL_STREAM_ZIP_HPP
|
|
|
|
#include <nall/unzip.hpp>
|
|
|
|
namespace nall {
|
|
|
|
struct zipstream : memorystream {
|
|
using stream::read;
|
|
using stream::write;
|
|
|
|
zipstream(const stream &stream, const string &filter = "*") {
|
|
unsigned size = stream.size();
|
|
uint8_t *data = new uint8_t[size];
|
|
stream.read(data, size);
|
|
|
|
unzip archive;
|
|
if(archive.open(data, size) == false) return;
|
|
delete[] data;
|
|
|
|
for(auto &file : archive.file) {
|
|
if(file.name.wildcard(filter)) {
|
|
auto buffer = archive.extract(file);
|
|
psize = buffer.size();
|
|
pdata = buffer.move();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
~zipstream() {
|
|
if(pdata) delete[] pdata;
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|