ICP  1
SingleFile.h
Go to the documentation of this file.
1 #ifndef SINGLE_FILE
2 #define SINGLE_FILE
3 
4 #include "icp_interfaces.h"
5 
6 class SingleFile : public IFile, public ISIS::Base
7 {
8 private:
9  FILE* m_file;
10  SingleFile(const SingleFile&) { }
11  void operator=(const SingleFile&) { m_file = NULL; }
12 
13 public:
14  SingleFile();
15  int open(const std::string& path, Mode mode, int shflag);
16  size_t write(const void* data, size_t element_size, size_t nelement);
17  size_t read(void* data, size_t element_size, size_t nelement);
18  int close();
19  int seek(int64_t offset, int whence);
20  int discardContents();
21  bool isOpen() const;
22  int flush();
23  ~SingleFile();
24  static void removeFile(const std::string& path);
25 };
26 
27 #endif /* SINGLE_FILE */
size_t read(void *data, size_t element_size, size_t nelement)
Definition: SingleFile.cpp:46
FILE * m_file
Definition: SingleFile.h:9
int flush()
Definition: SingleFile.cpp:77
bool isOpen() const
Definition: SingleFile.cpp:72
int open(const std::string &path, Mode mode, int shflag)
Definition: SingleFile.cpp:19
size_t write(const void *data, size_t element_size, size_t nelement)
Definition: SingleFile.cpp:41
int discardContents()
Definition: SingleFile.cpp:67
static void removeFile(const std::string &path)
Definition: SingleFile.cpp:14
int close()
Definition: SingleFile.cpp:51
int seek(int64_t offset, int whence)
Definition: SingleFile.cpp:62
SingleFile(const SingleFile &)
Definition: SingleFile.h:10
void operator=(const SingleFile &)
Definition: SingleFile.h:11