Buffered pager for storing paged strings for character protocol.
More...
#include <memory.h>
Public Member Functions |
void | add (const char *text) |
| Add text to string buffer.
|
| bufpager (size_t page=0) |
char * | copy (size_t *iosize) |
| Get pointer to copy character data.
|
char * | dup (void) |
| Create an output string from buffer.
|
size_t | get (char *text, size_t size) |
| Get string from buffer.
|
| operator bool () const |
| Check if can still save into buffer.
|
bool | operator! () const |
| Check if can still save into buffer.
|
char * | operator* () |
| Convenience operator to get text.
|
bufpager & | operator<< (const char *text) |
| Convenience operator to add to pager.
|
void | put (const char *text, size_t size) |
| Put memory string into buffer including NULL byte.
|
char * | request (size_t *iosize) |
| Request character buffer to write into directly.
|
void | reset (void) |
| Reset pager text buffer protocol.
|
void | rewind (void) |
| Rewind to start of text buffer protocol.
|
void | set (const char *text) |
| Set text of string buffer.
|
void | update (size_t size) |
| Used to complete a request method.
|
unsigned long | used (void) const |
| Get total size.
|
Protected Member Functions |
virtual void * | _alloc (size_t size) |
| Allocate memory from the pager heap.
|
Detailed Description
Buffered pager for storing paged strings for character protocol.
- Author:
- David Sugar <dyfet@gnutelephony.org>
Definition at line 660 of file memory.h.
Member Function Documentation
Allocate memory from the pager heap.
The size of the request must be less than the size of the memory page used. This implements the memory protocol allocation method.
- Parameters:
-
- Returns:
- allocated memory or NULL if not possible.
Reimplemented from ucommon::memalloc.
Add text to string buffer.
- Parameters:
-
Get pointer to copy character data.
The memory pointer is positioned at the next chunk automatically.
- Parameters:
-
iosize | of data you can copy. |
- Returns:
- to data from buffer or NULL if past end.
Create an output string from buffer.
- Returns:
- output string allocated.
Get string from buffer.
- Parameters:
-
text | to save into. |
size | of buffer. |
- Returns:
- count of characters copied.
ucommon::bufpager::operator bool |
( |
| ) |
const [inline] |
Check if can still save into buffer.
Used for is() function.
- Returns:
- true if pager can still store more.
Definition at line 779 of file memory.h.
Check if can still save into buffer.
- Returns:
- true if buffer is full.
Definition at line 772 of file memory.h.
char* ucommon::bufpager::operator* |
( |
| ) |
[inline] |
Convenience operator to get text.
- Returns:
- text string of buffer.
Definition at line 735 of file memory.h.
bufpager& ucommon::bufpager::operator<< |
( |
const char * |
text | ) |
[inline] |
Convenience operator to add to pager.
- Parameters:
-
Definition at line 742 of file memory.h.
Put memory string into buffer including NULL byte.
- Parameters:
-
text | to add. |
size | of text to add. |
Request character buffer to write into directly.
- Parameters:
-
- Returns:
- pointer to buffer or NULL if out of memory.
Set text of string buffer.
- Parameters:
-
Used to complete a request method.
- Parameters:
-
size | of data actually written. |
Get total size.
- Returns:
- number of characters in buffer.
Definition at line 728 of file memory.h.
The documentation for this class was generated from the following file:
- /usr/src/RPM/BUILD/ucommon-6.3.3/inc/ucommon/memory.h