Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » More Xmlize functions
More Xmlize functions [message #25404] Mon, 22 February 2010 09:02 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.
  • Attachment: Xmlize2.7z
    (Size: 0.82KB, Downloaded 205 times)


Best regards
Iñaki

[Updated on: Mon, 22 February 2010 13:17]

Report message to a moderator

Re: More Xmlize functions [message #25405 is a reply to message #25404] Mon, 22 February 2010 09:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 22 February 2010 03:02

Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.


Are you sure about implementing the time/date this way?

Maybe we should rather use XmlRpc format? (You can see that in XmlRpc package).

Mirek
Re: More Xmlize functions [message #25408 is a reply to message #25405] Mon, 22 February 2010 10:25 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
luzr wrote on Mon, 22 February 2010 09:16

koldo wrote on Mon, 22 February 2010 03:02

Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.


Are you sure about implementing the time/date this way?

Maybe we should rather use XmlRpc format? (You can see that in XmlRpc package).

Mirek


Hello Mirek

I thought XmlRpc protocol was not related with serialization.

Anyway if we do not have to use Xmlize it would be better to label it as deprecated. I have spent some hours in it until now.

If it is worthwhile to use it, please indicate me your way to implement time/date.



Best regards
Iñaki
Re: More Xmlize functions [message #25413 is a reply to message #25408] Mon, 22 February 2010 12:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 22 February 2010 04:25

luzr wrote on Mon, 22 February 2010 09:16

koldo wrote on Mon, 22 February 2010 03:02

Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.


Are you sure about implementing the time/date this way?

Maybe we should rather use XmlRpc format? (You can see that in XmlRpc package).

Mirek


Hello Mirek

I thought XmlRpc protocol was not related with serialization.

Anyway if we do not have to use Xmlize it would be better to label it as deprecated. I have spent some hours in it until now.

If it is worthwhile to use it, please indicate me your way to implement time/date.




Ops, nope. What I was saying that perhaps text format used in XmlRpc to represent the date with single attribute is better than to implement it with several.

See:

http://en.wikipedia.org/wiki/XML-RPC

they use

<dateTime.iso8601>19980717T14:08:55</dateTime.iso8601>

of course, in Xmlize, this might be something like

<id value="19980717T14:08:55">

Mirek
Re: More Xmlize functions [message #25414 is a reply to message #25413] Mon, 22 February 2010 12:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
luzr wrote on Mon, 22 February 2010 12:26

koldo wrote on Mon, 22 February 2010 04:25

luzr wrote on Mon, 22 February 2010 09:16

koldo wrote on Mon, 22 February 2010 03:02

Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.


Are you sure about implementing the time/date this way?

Maybe we should rather use XmlRpc format? (You can see that in XmlRpc package).

Mirek


Hello Mirek

I thought XmlRpc protocol was not related with serialization.

Anyway if we do not have to use Xmlize it would be better to label it as deprecated. I have spent some hours in it until now.

If it is worthwhile to use it, please indicate me your way to implement time/date.




Ops, nope. What I was saying that perhaps text format used in XmlRpc to represent the date with single attribute is better than to implement it with several.

See:

http://en.wikipedia.org/wiki/XML-RPC

they use

<dateTime.iso8601>19980717T14:08:55</dateTime.iso8601>

of course, in Xmlize, this might be something like

<id value="19980717T14:08:55">

Mirek

Sorry for the misunderstanding Smile

It makes sense. I will change it.


Best regards
Iñaki
Re: More Xmlize functions [message #25416 is a reply to message #25414] Mon, 22 February 2010 13:19 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
koldo wrote on Mon, 22 February 2010 12:41

luzr wrote on Mon, 22 February 2010 12:26

koldo wrote on Mon, 22 February 2010 04:25

luzr wrote on Mon, 22 February 2010 09:16

koldo wrote on Mon, 22 February 2010 03:02

Hello all

Xmlize functions are a nice way to get serialization using instead of a raw binary file, a XML file.

Advantages are:

- If you change your classes design, .xml data saved is read properly so your old .xml files are useful.

- They integrate very well with code

- Serialization file is a readable .xml file

Now Xmlize.c /.h supports many classes. However some classes and types are not included yet:

- int16
- byte
- Date
- Time
- DropList
- DropTime
- DropDate
- EditDouble
- Option


I have included new files Xmlize2.c / .h to support these types and classes.

If you want to use them just insert Xmlize2.c int your files and #include Xmlize2.h.

Of course they could be integrated in Core Xmlize.c /.h files Smile.


Are you sure about implementing the time/date this way?

Maybe we should rather use XmlRpc format? (You can see that in XmlRpc package).

Mirek


Hello Mirek

I thought XmlRpc protocol was not related with serialization.

Anyway if we do not have to use Xmlize it would be better to label it as deprecated. I have spent some hours in it until now.

If it is worthwhile to use it, please indicate me your way to implement time/date.




Ops, nope. What I was saying that perhaps text format used in XmlRpc to represent the date with single attribute is better than to implement it with several.

See:

http://en.wikipedia.org/wiki/XML-RPC

they use

<dateTime.iso8601>19980717T14:08:55</dateTime.iso8601>

of course, in Xmlize, this might be something like

<id value="19980717T14:08:55">

Mirek

Sorry for the misunderstanding Smile

It makes sense. I will change it.


Hello all

It is done. New version of Xmlize2.7z is included in previous post.


Best regards
Iñaki
Re: More Xmlize functions [message #25433 is a reply to message #25416] Tue, 23 February 2010 11:35 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
It would be interesting to have Value type xmlized.... I've done some small parts on my own because I needed it, but it's only for some basic types, and it's too quick-and-dirty to post here Smile

Btw, my polymorphic xmlizer could be a nice addition too... it's in Bazaar and I think it's quite functional now.

Ciao

Max
Re: More Xmlize functions [message #25525 is a reply to message #25433] Sat, 27 February 2010 18:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Tue, 23 February 2010 05:35

It would be interesting to have Value type xmlized.... I've done some small parts on my own because I needed it, but it's only for some basic types, and it's too quick-and-dirty to post here Smile

Btw, my polymorphic xmlizer could be a nice addition too... it's in Bazaar and I think it's quite functional now.

Ciao

Max




BTW, why do you create specific Xmlizes for CtrlLib types, IMO it should be possible to have just single generic one? (GetData/SetData).

(Only asking to be sure I have not missed anything Wink

Mirek
Re: More Xmlize functions [message #25529 is a reply to message #25525] Sat, 27 February 2010 23:51 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well, mostly because I needed some processing on ctrls loading.
My xmlizers were mostly aimed to solve a concrete problem, they are not generic ones.
BTW, I think it would be good to incorporate xmlize into ctrl, and to add OnLoad / OnStore handlers, I guess it could solve most streaming issues.

Ciao

Max
Re: More Xmlize functions [message #25532 is a reply to message #25529] Sun, 28 February 2010 09:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 27 February 2010 17:51

Well, mostly because I needed some processing on ctrls loading.
My xmlizers were mostly aimed to solve a concrete problem, they are not generic ones.
BTW, I think it would be good to incorporate xmlize into ctrl, and to add OnLoad / OnStore handlers, I guess it could solve most streaming issues.

Ciao

Max



That would mean all XML stuff gets always linked in. Something I am not really happy about...
Re: More Xmlize functions [message #25554 is a reply to message #25532] Mon, 01 March 2010 11:17 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
luzr wrote on Sun, 28 February 2010 09:28

mdelfede wrote on Sat, 27 February 2010 17:51

Well, mostly because I needed some processing on ctrls loading.
My xmlizers were mostly aimed to solve a concrete problem, they are not generic ones.
BTW, I think it would be good to incorporate xmlize into ctrl, and to add OnLoad / OnStore handlers, I guess it could solve most streaming issues.

Ciao

Max



That would mean all XML stuff gets always linked in. Something I am not really happy about...


Anyways, I don't think a generic ctrl Xmlizer would be very useful, at least, not a simple one. With the OnLoad/OnStore handlers( btw, you'd need a BeforeStore and AfterLoad ones, to be precise...) things would be better, but you'd have to link xml everywhere.

But, with Value xmlized now, to store/load controls becomes trivial.
A generic xmlizer would have problems, for example, with droplists which content depends/links to other controls which are in turn xmlized. On my code, most of the work is to keep in sync all that, not the streaming code itself which is really trivial.

More, In my code I store/internally use values in a single set of units (for example, Newton, mm, N/mm2, and so on) converting on the fly between textual controls contents which is user-customizable. So, when streaming in/out controls I have to perform such conversion, too.
That would be hardly achieved by a generic Xmlizer.

Ciao

Max
Previous Topic: Loss of digits in double Xmlize
Next Topic: FormatDouble and numbers under 1e-15
Goto Forum:
  


Current Time: Fri Mar 29 11:41:43 CET 2024

Total time taken to generate the page: 0.01243 seconds