View previous topic :: View next topic |
Author |
Message |
sepa
Joined: 06 May 2007 Posts: 13
|
Posted: Tue May 08, 2007 7:10 pm Post subject: Question about open a BIG file |
|
|
Hi.
Can i somehow open a files about 1-4Gb size in this component? (with 512Mb RAM =) It's need to use memory mapping? or read file by parts of 64k for example, and redraw position and size of scrollbar accordingly. It's not needed true syntax coloring in this case (analizing of whole file). I agreed with analizing/coloring of currently loaded/displayed part of file. But how to manipulate scrollbar?
I'm in start of path, and want to ask, which ways usually used for solution.
Can you give me some keywords, so i can read more about in internet?
Thnx. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue May 08, 2007 10:48 pm Post subject: |
|
|
Hello,
This component is not intended for such big files. All text is loaded to memory.
Using file-mapping is impossible, but partial loading is more realistic.
Possible implementation (for read-only):
1. Calculate line count and their positions in file (scan file by reading bytes, for this operation you may use file-mapping)
2. Initilize memo with empty lines.
3. Trace vertical scroll position to load visible lines plus surrounded lines (to minimize number of loading).
To implement editing you may store changed lines separetly and when loading portion of text take these lines instead of unchanged lines.
Michael. |
|
Back to top |
|
|
sepa
Joined: 06 May 2007 Posts: 13
|
Posted: Wed May 09, 2007 6:37 am Post subject: |
|
|
Thank you for fast answer. I'll try to implement this way |
|
Back to top |
|
|
|