VirtualBox

Changeset 32565 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Sep 16, 2010 2:39:24 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65958
Message:

Runtime/Main: add xml/ovf parsing in memory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/ovfreader.cpp

    r29893 r32565  
    3131
    3232/**
     33 * Constructor. This parses the given XML file out of the memory. Throws lots of exceptions
     34 * on XML or OVF invalidity.
     35 * @param pvBuf  the memory buffer to parse
     36 * @param cbSize the size of the memory buffer
     37 * @param path   path to a filename for error messages.
     38 */
     39OVFReader::OVFReader(const void *pvBuf, int cbSize, const MiniString &path)
     40    : m_strPath(path)
     41{
     42    xml::XmlMemParser parser;
     43    parser.read(pvBuf, cbSize,
     44                m_strPath,
     45                m_doc);
     46    /* Start the parsing */
     47    parse();
     48}
     49
     50/**
    3351 * Constructor. This opens the given XML file and parses it. Throws lots of exceptions
    3452 * on XML or OVF invalidity.
     
    4159    parser.read(m_strPath,
    4260                m_doc);
    43 
     61    /* Start the parsing */
     62    parse();
     63}
     64
     65void OVFReader::parse()
     66{
    4467    const xml::ElementNode *pRootElem = m_doc.getRootElement();
    4568    if (    !pRootElem
Note: See TracChangeset for help on using the changeset viewer.

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