PoDoFo::PdfRefCountedBuffer Class Reference
#include <PdfRefCountedBuffer.h>
List of all members.
Detailed Description
A reference counted buffer object which is deleted as soon as the last object having access to it is delteted.
The attached memory object can be resized.
Constructor & Destructor Documentation
PoDoFo::PdfRefCountedBuffer::PdfRefCountedBuffer |
( |
|
) |
[inline] |
Created an empty reference counted buffer The buffer will be initialize to NULL
PoDoFo::PdfRefCountedBuffer::PdfRefCountedBuffer |
( |
char * |
pBuffer, |
|
|
size_t |
lSize | |
|
) |
| | |
Created an reference counted buffer and use an exiting buffer The buffer will be owned by this object.
- Parameters:
-
| pBuffer | a pointer to an allocated buffer |
| lSize | size of the allocated buffer |
- See also:
- SetTakePossesion
PoDoFo::PdfRefCountedBuffer::PdfRefCountedBuffer |
( |
size_t |
lSize |
) |
[inline] |
PoDoFo::PdfRefCountedBuffer::~PdfRefCountedBuffer |
( |
|
) |
[inline] |
Decrease the reference count and delete the buffer if this is the last owner
Member Function Documentation
char * PoDoFo::PdfRefCountedBuffer::GetBuffer |
( |
|
) |
const [inline] |
Append to the current buffers contents. If the buffer is referenced by another PdfRefCountedBuffer this object detaches from this buffer and allocates an own buffer. Otherwise the internal buffer is used and resized if necessary.
- Parameters:
-
| pszString | a buffer |
| lLen | length of the buffer Get access to the buffer |
- Returns:
- the buffer
size_t PoDoFo::PdfRefCountedBuffer::GetSize |
( |
|
) |
const [inline] |
Return the buffer size.
- Returns:
- the buffer size
Compare to buffers.
- Parameters:
-
| rhs | compare to this buffer |
- Returns:
- true if this buffer is lexically littler than rhs
Copy an existing PdfRefCountedBuffer and increase the reference count
- Parameters:
-
- Returns:
- the copied object
Compare to buffers.
- Parameters:
-
| rhs | compare to this buffer |
- Returns:
- true if both buffers contain the same contents
Compare to buffers.
- Parameters:
-
| rhs | compare to this buffer |
- Returns:
- true if this buffer is lexically greater than rhs
void PoDoFo::PdfRefCountedBuffer::Resize |
( |
size_t |
lSize |
) |
[inline] |
Resize the buffer to hold at least lSize bytes.
- Parameters:
-
| lSize | the size of bytes the buffer can at least hold |
If the buffer is larger no operation is performed.
void PoDoFo::PdfRefCountedBuffer::SetTakePossesion |
( |
bool |
bTakePossession |
) |
[inline] |
If the PdfRefCountedBuffer has no possesion on its buffer, it won't delete the buffer. By default the buffer is owned and deleted by the PdfRefCountedBuffer object.
- Parameters:
-
| bTakePossession | if false the buffer will not be deleted. |
bool PoDoFo::PdfRefCountedBuffer::TakePossesion |
( |
|
) |
const [inline] |