VirtualBox

Changeset 33056 in vbox


Ignore:
Timestamp:
Oct 12, 2010 12:09:42 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66583
Message:

Main-XML: add a xml memory writer

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/xml.h

    r32565 r33056  
    567567    friend class XmlMemParser;
    568568    friend class XmlFileParser;
     569    friend class XmlMemWriter;
    569570    friend class XmlFileWriter;
    570571
     
    624625    static int ReadCallback(void *aCtxt, char *aBuf, int aLen);
    625626    static int CloseCallback (void *aCtxt);
     627};
     628
     629/*
     630 * XmlMemParser
     631 *
     632 */
     633
     634class RT_DECL_CLASS XmlMemWriter
     635{
     636public:
     637    XmlMemWriter();
     638    ~XmlMemWriter();
     639
     640    void write(const Document &doc, void** ppvBuf, size_t *pcbSize);
    626641};
    627642
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r32565 r33056  
    13871387////////////////////////////////////////////////////////////////////////////////
    13881388//
     1389// XmlMemWriter class
     1390//
     1391////////////////////////////////////////////////////////////////////////////////
     1392
     1393XmlMemWriter::XmlMemWriter()
     1394{
     1395}
     1396
     1397XmlMemWriter::~XmlMemWriter()
     1398{
     1399}
     1400
     1401void XmlMemWriter::write(const Document &doc, void **ppvBuf, size_t *pcbSize)
     1402{
     1403    xmlChar* pBuf;
     1404    int size;
     1405    xmlDocDumpFormatMemory(doc.m->plibDocument, &pBuf, &size, 1);
     1406    *ppvBuf = pBuf;
     1407    *pcbSize = size;
     1408}
     1409
     1410////////////////////////////////////////////////////////////////////////////////
     1411//
    13891412// XmlFileParser class
    13901413//
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette