xml.h revision f7b81dcd1a01325f5ca2806c2694b8f1d3b9eb4c
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * VirtualBox XML helper APIs.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Copyright (C) 2007-2009 Sun Microsystems, Inc.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * available from http://www.virtualbox.org. This file is free software;
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * General Public License (GPL) as published by the Free Software
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * The contents of this file may alternatively be used under the terms
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * of the Common Development and Distribution License Version 1.0
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * VirtualBox OSE distribution, in which case the provisions of the
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * CDDL are applicable instead of those of the GPL.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * You may elect to license modified versions of this file under the
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * terms and conditions of either the GPL or the CDDL or both.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * additional information or have any questions.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync# error "There are no XML APIs available in Ring-0 Context!"
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync/* Forwards */
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync// Exceptions
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync//////////////////////////////////////////////////////////////////////////////
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Base exception class.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync // hide the default constructor to make sure the extended one above is always used
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync// Logical errors
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync//////////////////////////////////////////////////////////////////////////////
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncclass RT_DECL_CLASS ENotImplemented : public LogicError
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync ENotImplemented(const char *aMsg = NULL) : LogicError(aMsg) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync ENotImplemented(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync EInvalidArg(const char *aMsg = NULL) : LogicError(aMsg) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync EInvalidArg(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncclass RT_DECL_CLASS EDocumentNotEmpty : public LogicError
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync EDocumentNotEmpty(const char *aMsg = NULL) : LogicError(aMsg) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync EDocumentNotEmpty(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncclass RT_DECL_CLASS ENodeIsNotElement : public LogicError
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync ENodeIsNotElement(const char *aMsg = NULL) : LogicError(aMsg) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync ENodeIsNotElement(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {}
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync// Runtime errors
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync//////////////////////////////////////////////////////////////////////////////
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsyncclass RT_DECL_CLASS EIPRTFailure : public RuntimeError
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * The Stream class is a base class for I/O streams.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Returns the current read/write position in the stream. The returned
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * position is a zero-based byte offset from the beginning of the file.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Throws ENotImplemented if this operation is not implemented for the
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * given stream.
a0f8619bc2bbe3614578c21b5b50a88d2841e7aavboxsync * Sets the current read/write position in the stream.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @param aPos Zero-based byte offset from the beginning of the stream.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Throws ENotImplemented if this operation is not implemented for the
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * given stream.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * The Input class represents an input stream.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * This input stream is used to read the settings tree from.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * This is an abstract class that must be subclassed in order to fill it with
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * useful functionality.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Reads from the stream to the supplied buffer.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @param aBuf Buffer to store read data to.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @param aLen Buffer length.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @return Number of bytes read.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Writes to the stream from the supplied buffer.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @param aBuf Buffer to write data from.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @param aLen Buffer length.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * @return Number of bytes written.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync virtual int write (const char *aBuf, int aLen) = 0;
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Truncates the stream from the current position and upto the end.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * The new file size will become exactly #pos() bytes.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * Throws ENotImplemented if this operation is not implemented for the
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * given stream.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync//////////////////////////////////////////////////////////////////////////////
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * The File class is a stream implementation that reads from and writes to
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * regular files.
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * The File class uses IPRT File API for file operations. Note that IPRT File
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * API is not thread-safe. This means that if you pass the same RTFILE handle to
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * different File instances that may be simultaneously used on different
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * threads, you should care about serialization; otherwise you will get garbage
632b4638bd18092c6b8edb4e1028c9be112f5076vboxsync * when reading from or writing to such File instances.
const char *uri() const;
void truncate();
struct Data;
Data *m;
const char *uri() const;
struct Data;
Data *m;
const char *aID,
GlobalLock();
~GlobalLock();
const char *aID,
struct Data;
struct Data *m;
~Node();
const char* getName() const;
const char* getValue() const;
int getLineNumber() const;
int isElement()
void buildChildren();
struct Data;
Data *m;
ElementNode();
ContentNode();
~NodesLoop();
struct Data;
Data *m;
Document();
~Document();
void refreshInternals();
struct Data;
Data *m;
~XmlParserBase();
~XmlFileParser();
struct Data;
struct Data *m;
~XmlFileWriter();
struct Data;
Data *m;
#if defined(_MSC_VER)