Having gotten sick of fighting VB for file access for any given project, I decided to write a DLL to handle such chores for me. I'm intending it as a write-once, use often, kinda deal. (The "FileSystemObject" is decent, but it only deals in text streams.)

Anyold how, looking for ideas on functions that would be useful. I'm intending this to present a single pointer to its client, and that navigation through a file would be handled with several different methods.

I intend to implement several different ways of navigating the file, each of which is at a different level of completion.

1d array (no real trick to this, so it's basically done.) Navigation is based on an offset from the current position (step) or the file beginning (jump)

2d array (a little math handles the fixed width. I'm going to only use powers of 2 as my width, so I can shift. ) BTW, does anyone have a efficient vertical wrap example? The two versions I've come up with don't handle imperfect rectangles very well. (The math is blazingly simple, otherwise. +-16 is a row, +-1 is a column) Navigation is handled through setting Row and Col, or by moving Up, Down, Left, or Right. (With wrapping and non-wrapping versions available. Non-wrapping are basically done. Wrapping are giving me fits, currently.)

2d Lines (Not very done.) Treat the file like a 2d array, but using variable row lengths based on terminator position. This will be handy for certain programs, but I've not yet seen a library where anyone bothered.
Again, navigation is as in the 2d array. I'm trying to decide what the best behavior for navigating into the area after a line should be.

I need any ideas on insertion. Bytes need to be insertable anywhere in the text, but currently I can only see how one would copy the entire file, byte for byte, into a new buffer. Alternately one could allocate more room, if available, after the file, and copy from the insertion point to the end of the file, offset by the amount inserted.

If anyone is interested in this, I'll post what I get when I get somewhere presentable.

Posted on 2003-06-04 16:14:49 by THENate