Actually, that is probably what most teams would do
Besides, this is a personal project i am working on, so i can do whatever i want.![]()
Where I work I have to think two steps ahead. Since most of what I do there is meant to be ready for "two weeks ago", before even the code is stable it is already being used by others who sometimes abuse it and changing my API (or just the code logic) without breaking their code is hard, so I have to first think how they might abuse my code tomorrow and then how to make sure them doing that will not break the code I will be writing next week. I'd certainly go for three methods in this case if I had to do it the way you do it. Well... I wouldn't do it like that but that's another thing. I'd probably either subclass QXmlStreamWriter or write a set of overloaded standalone functions for serialization just like QDataStream does. Especially that with XML you can implement inheritance by using subnodes which is much more readable.
xml Code:
<SubObject> <parent> <Object> <!-- ... --> </Object> </parent> <attributes> <!-- ... --> </attributes> </SubObject>To copy to clipboard, switch view to plain text mode
On a side note, this is also how ECMAScript implements "inheritance" - by using prototypes.
Bookmarks