#include "File.h" #include File::File(const char *name, const char *flags) { f = fopen(name, flags); if (!f) printf("WARNING: Cannot open '%s'\n", name); } File::~File() { fclose(f); } char File::Getc() const { return fgetc(f); } int File::Eof() const { return feof(f); } void File::Seek(long pos) const { fseek(f, pos, SEEK_SET); } void File::Reset() const { fseek(f, 0, SEEK_SET); } long File::Tell() const { return ftell(f); } long File::Size() const { long l = ftell(f); fseek(f, 0, SEEK_END); long s = ftell(f); fseek(f, l, SEEK_SET); return s; } char *File::Gets(char *c, int cnt) const { for (int i=0; i