Changeset 36405 in vbox for trunk/src/VBox
- Timestamp:
- Mar 24, 2011 3:57:03 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70760
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r36395 r36405 52 52 53 53 /* 54 * Copyright (C) 2007-201 0Oracle Corporation54 * Copyright (C) 2007-2011 Oracle Corporation 55 55 * 56 56 * This file is part of VirtualBox Open Source Edition (OSE), as … … 864 864 m->pDoc = new xml::Document; 865 865 866 m->pelmRoot = m->pDoc->createRootElement("VirtualBox"); 866 m->pelmRoot = m->pDoc->createRootElement("VirtualBox", 867 "\n" 868 "** DO NOT EDIT THIS FILE.\n" 869 "** If you make changes to this file while any VirtualBox related application\n" 870 "** is running, your changes will be overwritten later, without taking effect.\n" 871 "** Use VBoxManage or the VirtualBox Manager GUI to make changes.\n" 872 ); 867 873 m->pelmRoot->setAttribute("xmlns", VBOX_XML_NAMESPACE); 868 874 -
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.