Anyone using the brl.data module?

BlitzMax Forums/BlitzMax Programming/Anyone using the brl.data module?

Oddball(Posted 2008) [#1]
I've been looking at various ways to read/write my objects directly from/to a TStream. Whilst digging in the Blitz Max source I found TData and TDataType. On the surface these do exactly what I'm looking for, but they are totally undocumented as far as I can tell. My question is, is anyone using these types and do they indeed do what I think they do? Are they safe to use, or were they intended for internal use only?


Volker(Posted 2008) [#2]
I've been looking at various ways to read/write my objects directly from/to a TStream.

Bruceys persistence mod can do this via reflection.
Did you test it?


plash(Posted 2008) [#3]
I prefer to handle that by serialize and deserialize methods for a type.


Otus(Posted 2008) [#4]
I used them once to implement some custom data structure in a stream friendly way. Check out BRL.LinkedList to see how they are used.


tonyg(Posted 2008) [#5]
Does this help?


Oddball(Posted 2008) [#6]
Thanks for all the replies. It turns out the solution to my problem was amazingly simple. I'm only reading/writing pixmaps to streams, and it seems LoadPixmap and SavePixmap can be given any TStream at any position.

@Volkar: Hadn't seen that module before. It's a bit overkill for what I'm doing at the moment, but I have a back burner project that it seems perfectly suited for. So thanks for bringing it to my attention.

@tonyg: That's about as far as I had got by looking at the source, but TPixmapDataType.ReadObject didn't return anything so it was confusing me.