Changeset 36405 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 24, 2011 3:57:03 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70760
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/xml.cpp
r35729 r36405 5 5 6 6 /* 7 * Copyright (C) 2007-201 0Oracle Corporation7 * Copyright (C) 2007-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1308 1308 xmlDocPtr plibDocument; 1309 1309 ElementNode *pRootElement; 1310 ElementNode *pComment; 1310 1311 1311 1312 Data() … … 1313 1314 plibDocument = NULL; 1314 1315 pRootElement = NULL; 1316 pComment = NULL; 1315 1317 } 1316 1318 … … 1403 1405 * only work if the document is empty; otherwise EDocumentNotEmpty is thrown. 1404 1406 */ 1405 ElementNode* Document::createRootElement(const char *pcszRootElementName) 1407 ElementNode* Document::createRootElement(const char *pcszRootElementName, 1408 const char *pcszComment /* = NULL */) 1406 1409 { 1407 1410 if (m->pRootElement || m->plibDocument) … … 1415 1418 throw std::bad_alloc(); 1416 1419 xmlDocSetRootElement(m->plibDocument, plibRootNode); 1417 1418 1420 // now wrap this in C++ 1419 1421 m->pRootElement = new ElementNode(NULL, NULL, plibRootNode); 1422 1423 // add document global comment if specified 1424 if (pcszComment != NULL) 1425 { 1426 xmlNode *pComment; 1427 if (!(pComment = xmlNewDocComment(m->plibDocument, 1428 (const xmlChar *)pcszComment))) 1429 throw std::bad_alloc(); 1430 xmlAddPrevSibling(plibRootNode, pComment); 1431 // now wrap this in C++ 1432 m->pComment = new ElementNode(NULL, NULL, pComment); 1433 } 1420 1434 1421 1435 return m->pRootElement;
Note:
See TracChangeset
for help on using the changeset viewer.