|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
7 #ifndef ELM_BLOCK_DYNBLOCK_H
8 #define ELM_BLOCK_DYNBLOCK_H
10 namespace elm {
namespace block {
18 void put(
const char *block,
int size);
19 void get(
char *block,
int size,
int pos);
21 inline int size(
void)
const {
return _size; }
22 inline int capacity(
void)
const {
return cap; }
24 inline void setSize(
int new_size) { _size = new_size; }
25 inline void reset(
void) { _size = 0;
if(!buf) buf =
new char[cap]; }
26 inline const char *
base(
void)
const {
return buf; }
28 {
char *result = buf; buf = 0;
return result; }
37 #endif // ELM_BLOCK_DYNBLOCK_H
int increment(void) const
Definition: DynBlock.h:23
DynBlock(int capacity=256, int increment=64)
Definition: DynBlock.h:15
const T & min(const T &x, const T &y)
Definition: compare.h:104
~DynBlock(void)
Definition: DynBlock.h:17
char * alloc(int size)
Definition: block_DynBlock.cpp:139
int capacity(void) const
Definition: DynBlock.h:22
void put(const char *block, int size)
Definition: block_DynBlock.cpp:57
int size(void) const
Definition: DynBlock.h:21
char * detach(void)
Definition: DynBlock.h:27
const char * base(void) const
Definition: DynBlock.h:26
void setSize(int new_size)
Definition: DynBlock.h:24
void get(char *block, int size, int pos)
Definition: block_DynBlock.cpp:77
void reset(void)
Definition: DynBlock.h:25
Definition: DynBlock.h:13