ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbTMPFILE.hpp
Go to the documentation of this file.
1
8#ifndef ngcbTMPFILE_H
9#define ngcbTMPFILE_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <stdlib.h>
17#include <stdio.h>
18#include <unistd.h>
19#include <fcntl.h>
20#include <string.h>
21
26{
27public:
29 FILE *fd;
30
32 ngcbTMPFILE &operator=(const ngcbTMPFILE &other);
33
35 ngcbTMPFILE(const ngcbTMPFILE &other);
36
39
41 virtual ~ngcbTMPFILE();
42
44 const char *ErrMsg();
45
47 size_t Size();
48
50 void Remove();
51
53 void Rewind();
54
56 void Append();
57
59 void Clear();
60
62 int Copy(FILE *fd);
63
65 int Copy(const char *fileName);
66
68 size_t Copy(void *buffer, size_t max, off_t offset = 0L);
69
70protected:
71
72private:
74 char erms_[256];
75
77 int Copy_(FILE *fd, char *erms) const;
78
79};
80
81#endif
virtual ~ngcbTMPFILE()
Destructor.
Definition ngcbTMPFILE.cpp:47
void Clear()
Rewind back to the beginning of file and truncate.
Definition ngcbTMPFILE.cpp:89
void Rewind()
Rewind back to the beginning of file.
Definition ngcbTMPFILE.cpp:75
int Copy(FILE *fd)
Copy all content to stream.
Definition ngcbTMPFILE.cpp:99
const char * ErrMsg()
Return error message.
Definition ngcbTMPFILE.cpp:49
ngcbTMPFILE & operator=(const ngcbTMPFILE &other)
Operator =.
Definition ngcbTMPFILE.cpp:26
size_t Size()
Return actual size of temporary file.
Definition ngcbTMPFILE.cpp:51
ngcbTMPFILE(const ngcbTMPFILE &other)
Copy constructor.
Definition ngcbTMPFILE.cpp:32
void Append()
Jump to end of file.
Definition ngcbTMPFILE.cpp:84
void Remove()
Remove temporary file.
Definition ngcbTMPFILE.cpp:67
ngcbTMPFILE()
Constructor.
Definition ngcbTMPFILE.cpp:40
FILE * fd
File pointer.
Definition ngcbTMPFILE.hpp:29