ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcbTMPFILE.hpp
Go to the documentation of this file.
1
7#ifndef ngcbTMPFILE_H
8#define ngcbTMPFILE_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <stdlib.h>
16#include <stdio.h>
17#include <unistd.h>
18#include <fcntl.h>
19#include <string.h>
20
25{
26public:
28 FILE *fd;
29
31 ngcbTMPFILE &operator=(const ngcbTMPFILE &other);
32
34 ngcbTMPFILE(const ngcbTMPFILE &other);
35
38
40 virtual ~ngcbTMPFILE();
41
43 const char *ErrMsg();
44
46 size_t Size();
47
49 void Remove();
50
52 void Rewind();
53
55 void Append();
56
58 void Clear();
59
61 int Copy(FILE *fd);
62
64 int Copy(const char *fileName);
65
67 size_t Copy(void *buffer, size_t max, off_t offset = 0L);
68
69protected:
70
71private:
73 char erms_[256];
74
76 int Copy_(FILE *fd, char *erms) const;
77
78};
79
80#endif
virtual ~ngcbTMPFILE()
Destructor.
Definition ngcbTMPFILE.cpp:46
void Clear()
Rewind back to the beginning of file and truncate.
Definition ngcbTMPFILE.cpp:88
void Rewind()
Rewind back to the beginning of file.
Definition ngcbTMPFILE.cpp:74
int Copy(FILE *fd)
Copy all content to stream.
Definition ngcbTMPFILE.cpp:98
const char * ErrMsg()
Return error message.
Definition ngcbTMPFILE.cpp:48
ngcbTMPFILE & operator=(const ngcbTMPFILE &other)
Operator =.
Definition ngcbTMPFILE.cpp:25
size_t Size()
Return actual size of temporary file.
Definition ngcbTMPFILE.cpp:50
ngcbTMPFILE(const ngcbTMPFILE &other)
Copy constructor.
Definition ngcbTMPFILE.cpp:31
void Append()
Jump to end of file.
Definition ngcbTMPFILE.cpp:83
void Remove()
Remove temporary file.
Definition ngcbTMPFILE.cpp:66
ngcbTMPFILE()
Constructor.
Definition ngcbTMPFILE.cpp:39
FILE * fd
File pointer.
Definition ngcbTMPFILE.hpp:28