hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FileWriter.h
Go to the documentation of this file.
1 #ifndef FILEWRITER_H
2 #define FILEWRITER_H
3 #include <sys/types.h>
4 #include <stdlib.h>
5 #include <unistd.h>
6 #include <errno.h>
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <fcntl.h>
10 #include <string.h>
12 {
13  public:
14  FileWriter(ssize_t bufSize = 1 << 20);
15  ~FileWriter();
16  bool open(const char *name, mode_t mode = 0666);
17  bool flush();
18  bool write(const void *src, ssize_t size);
19  void close();
20  int getLastErrNo(){return lastErrNo;}
21  private:
22  int lastErrNo;
23  char *buffer;
24  ssize_t size;
25  ssize_t pos;
26  int file;
27  bool isOpen;
28 };
29 #endif