mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu says: This is a few days old, but oh well. This WIP changes nall,hiro,ruby,icarus back to (u)int(8,16,32,64)_t. I'm slowly pushing for (u)int(8,16,32,64) to use my custom Integer<Size>/Natural<Size> classes instead. But it's going to be one hell of a struggle to get that into higan.
21 lines
701 B
C++
21 lines
701 B
C++
#pragma once
|
|
|
|
namespace nall {
|
|
|
|
#define autostream(...) (*makestream(__VA_ARGS__))
|
|
|
|
inline auto makestream(const string& path) -> std::unique_ptr<stream> {
|
|
if(path.iendsWith(".gz")) return std::unique_ptr<stream>(new gzipstream(filestream{path}));
|
|
if(path.iendsWith(".zip")) return std::unique_ptr<stream>(new zipstream(filestream{path}));
|
|
return std::unique_ptr<stream>(new mmapstream(path));
|
|
}
|
|
|
|
inline auto makestream(uint8_t* data, uint size) -> std::unique_ptr<stream> {
|
|
return std::unique_ptr<stream>(new memorystream(data, size));
|
|
}
|
|
|
|
inline auto makestream(const uint8_t* data, uint size) -> std::unique_ptr<stream> {
|
|
return std::unique_ptr<stream>(new memorystream(data, size));
|
|
}
|
|
|
|
}
|