mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Move buffering to Reader
This commit is contained in:
@@ -202,10 +202,10 @@ unique_ptr<wxInputStream> Package::openIn(const String& file) {
|
|||||||
unique_ptr<wxInputStream> stream;
|
unique_ptr<wxInputStream> stream;
|
||||||
if (it != files.end() && it->second.wasWritten()) {
|
if (it != files.end() && it->second.wasWritten()) {
|
||||||
// written to this file, open the temp file
|
// written to this file, open the temp file
|
||||||
stream = make_unique<BufferedFileInputStream>(it->second.tempName);
|
stream = make_unique<wxFileInputStream>(it->second.tempName);
|
||||||
} else if (wxFileExists(filename+_("/")+file)) {
|
} else if (wxFileExists(filename+_("/")+file)) {
|
||||||
// a file in directory package
|
// a file in directory package
|
||||||
stream = make_unique<BufferedFileInputStream>(filename+_("/")+file);
|
stream = make_unique<wxFileInputStream>(filename+_("/")+file);
|
||||||
} else if (wxFileExists(filename) && it != files.end() && it->second.zipEntry) {
|
} else if (wxFileExists(filename) && it != files.end() && it->second.zipEntry) {
|
||||||
// a file in a zip archive
|
// a file in a zip archive
|
||||||
stream = make_unique<ZipFileInputStream>(filename, it->second.zipEntry);
|
stream = make_unique<ZipFileInputStream>(filename, it->second.zipEntry);
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ private:
|
|||||||
/// Line number of the previous_line
|
/// Line number of the previous_line
|
||||||
int previous_line_number;
|
int previous_line_number;
|
||||||
/// Input stream we are reading from
|
/// Input stream we are reading from
|
||||||
wxInputStream& input;
|
wxBufferedInputStream input;
|
||||||
/// Accumulated warning messages
|
/// Accumulated warning messages
|
||||||
String warnings;
|
String warnings;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user