00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _SOCKETS_File_H
00031 #define _SOCKETS_File_H
00032
00033 #include "sockets-config.h"
00034 #include "IFile.h"
00035 #include <stdio.h>
00036
00037 #ifdef SOCKETS_NAMESPACE
00038 namespace SOCKETS_NAMESPACE {
00039 #endif
00040
00041
00044 class File : public IFile
00045 {
00046 public:
00047 File();
00048 ~File();
00049
00050 bool fopen(const std::string&, const std::string&);
00051 void fclose() const;
00052
00053 size_t fread(char *, size_t, size_t) const;
00054 size_t fwrite(const char *, size_t, size_t);
00055
00056 char *fgets(char *, int) const;
00057 void fprintf(const char *format, ...);
00058
00059 off_t size() const;
00060 bool eof() const;
00061
00062 void reset_read() const;
00063 void reset_write();
00064
00065 private:
00066 File(const File& ) {}
00067 File& operator=(const File& ) { return *this; }
00068
00069 std::string m_path;
00070 std::string m_mode;
00071 mutable FILE *m_fil;
00072 mutable long m_rptr;
00073 long m_wptr;
00074 };
00075
00076
00077
00078
00079 #ifdef SOCKETS_NAMESPACE
00080 }
00081 #endif
00082
00083 #endif // _SOCKETS_File_H
00084