You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
537 B
38 lines
537 B
#pragma once
|
|
|
|
namespace SOUI{
|
|
|
|
class UTILITIES_API SAutoBuf
|
|
{
|
|
public:
|
|
SAutoBuf();
|
|
|
|
SAutoBuf(size_t nElements);
|
|
|
|
~SAutoBuf();
|
|
|
|
operator char *() const;
|
|
|
|
char* operator ->() const;
|
|
|
|
const char & operator[] (int i) const;
|
|
|
|
char & operator[] (int i);
|
|
|
|
void Attach(char *pBuf,size_t size);
|
|
|
|
//return buffer, must be freed using soui_mem_wrapper::SouiFree
|
|
char *Detach();
|
|
|
|
char* Allocate(size_t nElements);
|
|
|
|
size_t size();
|
|
|
|
void Free();
|
|
private:
|
|
char * m_pBuf;
|
|
size_t m_nSize;
|
|
bool m_bExternalBuf;
|
|
};
|
|
|
|
}
|
|
|