diff options
Diffstat (limited to 'src/file.cpp')
-rw-r--r-- | src/file.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/file.cpp b/src/file.cpp deleted file mode 100644 index 9910b8a..0000000 --- a/src/file.cpp +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | #include "file.h" | ||
2 | #include "exceptions.h" | ||
3 | |||
4 | File::File( const char *sName, const char *sFlags ) | ||
5 | { | ||
6 | fh = fopen( sName, sFlags ); | ||
7 | } | ||
8 | |||
9 | File::~File() | ||
10 | { | ||
11 | } | ||
12 | |||
13 | void File::close() | ||
14 | { | ||
15 | if( fh ) | ||
16 | { | ||
17 | fclose( fh ); | ||
18 | fh = NULL; | ||
19 | } | ||
20 | } | ||
21 | |||
22 | size_t File::read( char *pBuf, size_t nBytes ) | ||
23 | { | ||
24 | if( !fh ) | ||
25 | throw FileException("File not open."); | ||
26 | |||
27 | return fread( pBuf, 1, nBytes, fh ); | ||
28 | } | ||
29 | |||
30 | size_t File::write( char *pBuf, size_t nBytes ) | ||
31 | { | ||
32 | if( !fh ) | ||
33 | throw FileException("File not open."); | ||
34 | |||
35 | return fwrite( pBuf, 1, nBytes, fh ); | ||
36 | } | ||
37 | |||