added tempbuf class
This commit is contained in:
parent
e57408bf7c
commit
d49d2eec3d
@ -128,6 +128,25 @@ class Chrono {
|
|||||||
long m_nsecs;
|
long m_nsecs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TempBuf {
|
||||||
|
public:
|
||||||
|
TempBuf()
|
||||||
|
: m_buf(0)
|
||||||
|
{}
|
||||||
|
TempBuf(int n)
|
||||||
|
{
|
||||||
|
m_buf = (char *)malloc(n);
|
||||||
|
}
|
||||||
|
~TempBuf()
|
||||||
|
{
|
||||||
|
if (m_buf)
|
||||||
|
free(m_buf);
|
||||||
|
}
|
||||||
|
char *setsize(int n) { return (m_buf = (char *)realloc(m_buf, n)); }
|
||||||
|
char *buf() {return m_buf;}
|
||||||
|
char *m_buf;
|
||||||
|
};
|
||||||
|
|
||||||
#ifndef deleteZ
|
#ifndef deleteZ
|
||||||
#define deleteZ(X) {delete X;X = 0;}
|
#define deleteZ(X) {delete X;X = 0;}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user