[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Standard data buffer?
- From: Asko Kauppi <asko.kauppi@...>
- Date: Mon, 13 Sep 2004 18:10:06 +0300
Sounds like, with these there wouldn't be need for files any more.. :)
13.9.2004 kello 14:45, Philippe Lhoste kirjoitti:
Mark Hamburg wrote:
Are there any standard data buffer APIs (or implementations) for Lua?
thinking about something much like strings but editable and not
For example, if I'm reading a JPEG, turning the bytes into a string
like excessive work for the code to go through. Actually, there are a
cases where this might be useful such as text file processing if the
pattern match facilities were made to work on data buffers.
I can certainly implement something like this, but I'd favor a
API/implementation if one existed.
This looks like the string buffer I wished to have not so long ago...
Of course, by "string", I mean data, ie. it can store whatever bytes
you want to put there.
Such a string buffer should allow to read a range of bytes, apply all
Lua string operations on a range, add data to the current end of the
buffer (or at any position, overwriting or inserting), with definable
behavior in case of overflow: either truncate written data, perhaps
with a kind of exception rising, or growth the buffer to fit the
additional data and more. Etc.
I really should work on it, unless somebody has done it (Tiago's
lustring?) or write it before me...
-- (near) Paris -- France
-- Professional programmer and amateur artist
-- -- -- -- -- -- -- -- -- -- -- --