gap buffer in D2

Spacen Jasset spacenjasset at yahoo.co.uk
Fri Nov 6 07:09:32 PST 2009


Spacen Jasset wrote:
> BLS wrote:
>> On 05/11/2009 01:04, Spacen Jasset wrote:
>>> BLS wrote:
>>>> yep, mean it...
>>>>
>>>> has somebody done it before...to me it seems to be not as trivial as
>>>> it looks on the very first view. (speed matters)
>>>>
>>>>
>>> Did one in C once for an editor (of course). Does that count? I might be
>>> able to find the code. It might not be pretty I can't remember.
>>
>> YEP,would be nice to have a look. thanks!
>>
>> would be interesting to have a 2 gaps buffer for beyond-end insert 
>> (append)
> Perhaps, if you expect things to be inserted in the middle and at the 
> end at the same time/alternately.
> 
> I can't quite remember why I have this gap buffer. I do remember that I 
> was going to have some sort of linked list of gap buffers for editing 
> large files. The code should work. It's used in an old hex editor which 
> works ok.
> 
> http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.C
> and
> http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.h
> 
By the way. it's isn't very quick at all. Some memcpy's would be 
required at least, rather than the for loops.


More information about the Digitalmars-d-learn mailing list