refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@255 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
This commit is contained in:
parent
cf1fe30715
commit
3cec8e0aa8
@ -23,6 +23,8 @@ using namespace std;
|
|||||||
|
|
||||||
static const unsigned int MAX_FILE_NAME = 512;
|
static const unsigned int MAX_FILE_NAME = 512;
|
||||||
|
|
||||||
|
namespace gambatte {
|
||||||
|
|
||||||
File::File(const char *filename) : stream(filename, ios::in | ios::binary), is_zip(false), fsize(0), count(0)
|
File::File(const char *filename) : stream(filename, ios::in | ios::binary), is_zip(false), fsize(0), count(0)
|
||||||
{
|
{
|
||||||
if (stream)
|
if (stream)
|
||||||
@ -71,3 +73,5 @@ void File::read(char *buffer, size_t amount)
|
|||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -19,6 +19,8 @@ Free Software Foundation, Inc.,
|
|||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
namespace gambatte {
|
||||||
|
|
||||||
class File {
|
class File {
|
||||||
private:
|
private:
|
||||||
std::ifstream stream;
|
std::ifstream stream;
|
||||||
@ -40,3 +42,5 @@ class File {
|
|||||||
std::size_t gcount() const { return count; }
|
std::size_t gcount() const { return count; }
|
||||||
bool fail() const { return stream.fail(); }
|
bool fail() const { return stream.fail(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -30,6 +30,8 @@ using namespace zlib;
|
|||||||
|
|
||||||
static const unsigned int MAX_FILE_NAME = 512;
|
static const unsigned int MAX_FILE_NAME = 512;
|
||||||
|
|
||||||
|
namespace gambatte {
|
||||||
|
|
||||||
File::File(const char *filename) : stream(filename, ios::in | ios::binary), is_zip(false), fsize(0), count(0)
|
File::File(const char *filename) : stream(filename, ios::in | ios::binary), is_zip(false), fsize(0), count(0)
|
||||||
{
|
{
|
||||||
if (stream)
|
if (stream)
|
||||||
@ -165,3 +167,5 @@ void File::read(char *buffer, size_t amount)
|
|||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user