Re: Stdio.Buffer, need a way to revisit old positions in the output
"Per Hedbor () @ Pike (-) importm?te f?r mailinglistan" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
> Well, it would appear so, however, do keep in mind that: > a. The get_addpos() positions implicitly give me a way to find out > how much bytes are between position A and B. So the length calculations > I need are already there, whereas using a writable subbuffer like above > doesn't give me those yet. It would, actually, allow getting the size: sizeof(subbuff). > b. Using the writeable subbuffer is tricky at best, and cannot be considered > lightweight anymore; get/set_addpos are practically for free. And, yes, it would be a larger change to the internals. It would however automate the 'do not write more than' code, and the 'update length field' code. -- Per Hedbor