Page 1 of 1

A small object manager

Posted: Sun Jan 25, 2009 11:53 am
by BlueShark
Hello,

I'm writing a small object manager and I need some help. I've added a couple of features but I think that there are some vital ones missing. Here is a short list:
already programmed
  • -writing and reading objects
    -handling the object index
    -moving objects
But here comes the long list:
my wish list^^
  • -writing wxString-objects
    -checking free harddrive space
    -checking file system
    -getting the current time and date and save in the file
    -using other classes for the class
How it works:
It's simple. You give the class object a path to a file and then you can easily pump objects into the class without looking after formatting the file. Later you can access the objects through an index function or sort the objects. I know that I should use a database for something like that but in my opinion that would be too much overhead.

Could you give me some hints on how I can improve my class?

I want to get rid of the input and output streams and use a stream which can do both at the same time like wxFileStream but like I said, I don't know how to write a wxString properly.

Posted: Mon Jan 26, 2009 6:40 am
by Jorg
Hi have you tried wxSerialize? It might save you some effort in writing that yourself.

http://www.xs4all.nl/~jorgb/wb/MyProjec ... alize.html

Cross platform and supports many wx classes by default
With regards,
- Jorgen

Posted: Mon Jan 26, 2009 7:56 am
by catalin
I also like wxSerialize - very simple, with a nice&easy version-ing option.

If you need a human readable format you could take a peak at wxJSON, or the JSON format in general.

Posted: Mon Jan 26, 2009 2:54 pm
by BlueShark
I am feeling a little bit.....don't know how to describe it. I actually searched for smth. like an serilization-class in wxWidgets but never found anything like it.

Thank you so much for that link. Now I only write a few methods an have done my whole work.

Mfg
BlueShark