Modules |
Files |
Inheritance Tree |
Inheritance Graph |
Name Index
template <class T, short gapsize>
class GapBuffer
Files: GapBuffer.hh
the design of a gap buffer should follow the typical behavior
when editing text. Editing text has two parts: modifying it
and simply browsing it. The text contains a 'cursor', which indicates
the actual position. When in editing mode, we have to take care to
use smart memory management. For this purpose we introduce a little
memory gap into the string where new characters can be inserted,
so not on every insert() all the following characters have to be moved
a gap buffer is layed out like this:
|***********************..........**********|
^ ^ ^ ^
begin() gbegin() gend() end()
the following (in)equalities should always hold:
gend() > gbegin()
gend() - gbegin() <= gmaxsize()
end() >= gend()
| Public Member function Details: |
void forward() these are methods to control the cursor position. This is a long
description for this group, but it will only be displayed if any of its
contents has a long description. Hmm, but then the group is a child of its
own section so thats okay!
{ Group1
move the cursor one position forward
void backward() move the cursor one position back
void shift(size_type d) shift the cursor d positions
size_type position() return the current position
void position(size_type p) set the current position
void insert(value_type u) }
Insert an item
Generated on Tue Nov 18 15:03:39 2003 by
synopsis