cornelius / kode

XML meta programming
http://www.lst.de/~cs/kode
20 stars 10 forks source link

[kxml_compiler]Pointer based accessor code generation #20

Open martonmiklos opened 5 years ago

martonmiklos commented 5 years ago

Hi @cornelius, @dfaure

Recently I needed to create a tool (with Qt) which parses an XML, modify a few thing and write it back to file. If I use the current kxml_compiler generated code I need to copy the whole parsed structure to do these modifications.

I was thinking about extending the kxml_compiler to add an option which would allow to generate classes having pointer based accessors.

What do you think about this approach?

dfaure-kdab commented 5 years ago

That's interesting. But pointers always open up the question about creation and ownership... Maybe unique_ptr would help (shared_ptr sounds like overkill).