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++ Library : Other (not classified elsewhere) » Polymorphic XML
Polymorphic XML [message #24336] Mon, 11 January 2010 13:57 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
I need to save/restore a class hyerarchy to/from stream; the result should be something like that :

<Pages>
    <Page class = "myclass">
    ....here object content, as per Xmlize
    </Page>
</Pages>


I already have a class factory able to create class by name, but I don't know how to put all together. In particular, I need to work with streams, not files; the code should be able to read/write from the current byte of stream, and leave it positioned on next data.
Assuming 'Page' is my hierarchy base class, it should be :

Page *CreatePage(const char *className);  <== DONE
Array<String> GetAvailablePages(void);    <== DONE

class page
{
    protected:
        virtual void Xmlize(XmlIo xml) = 0;  <== EASY, I think
    public:
        static Page *LoadStream(Stream &s);  <== ???
        virtual bool SaveStream(Stream &s);  <== ???

}


Any hint on how to do it ?

Ciao

Max
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Painter DrawLineStroke proposal
Next Topic: BUG: plugins\zip
Goto Forum:
  


Current Time: Sun Apr 28 10:14:09 CEST 2024

Total time taken to generate the page: 0.03493 seconds