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 functions Summary:
 constructorGapBuffer() [xref] [Source]
 size_typesize() [xref] [Source]
 voidforward() [xref] [Source]
 voidbackward() [xref] [Source]
 voidshift(size_type d) [xref] [Source]
 size_typeposition() [xref] [Source]
 voidposition(size_type p) [xref] [Source]
 voidinsert(value_type u) [xref] [Source]
 voidinsert(value_type* u, size_type n) [xref] [Source]
 voidremove_backward(size_type n) [xref] [Source]
 voidremove_forward(size_type n) [xref] [Source]
const value_type*get() [xref] [Source]

Private Typedefs Summary:
std::vectorrep_type [xref] [Source]
std::vector::value_typevalue_type [xref] [Source]

Private Member functions Summary:
 iteratorgbegin() [xref] [Source]
 iteratorgend() [xref] [Source]
 iteratorcursor() [xref] [Source]
 voidnewgap() [xref] [Source]
 voidmovegap(int d) [xref] [Source]
 size_typegap() [xref] [Source]
 voidediting() [xref] [Source]
 voidcompact() [xref] [Source]

Private Data members Summary:
size_typecurs [xref] [Source]
size_typegapbegin [xref] [Source]
size_typegapend [xref] [Source]

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