| Line | |
|---|
| 1 | #ifndef FILE_H
|
|---|
| 2 | #define FILE_H
|
|---|
| 3 |
|
|---|
| 4 | #include <stdio.h>
|
|---|
| 5 |
|
|---|
| 6 | class File
|
|---|
| 7 | {
|
|---|
| 8 | private:
|
|---|
| 9 | FILE *f;
|
|---|
| 10 |
|
|---|
| 11 | public:
|
|---|
| 12 | File(const char *name, const char *flags);
|
|---|
| 13 | ~File();
|
|---|
| 14 |
|
|---|
| 15 | void Reset() const;
|
|---|
| 16 | int Eof() const;
|
|---|
| 17 |
|
|---|
| 18 | void Seek(long pos) const;
|
|---|
| 19 | long Tell() const;
|
|---|
| 20 | long Size() const;
|
|---|
| 21 |
|
|---|
| 22 | char Getc() const;
|
|---|
| 23 | char *Gets(char *c, int cnt) const;
|
|---|
| 24 | int Geti(int cnt) const;
|
|---|
| 25 | float Getf(int cnt) const;
|
|---|
| 26 |
|
|---|
| 27 | void Newline() const;
|
|---|
| 28 | void Skip(int cnt) const;
|
|---|
| 29 |
|
|---|
| 30 | int operator!() { return !f; }
|
|---|
| 31 | };
|
|---|
| 32 |
|
|---|
| 33 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.