Changeset 17362 in vbox for trunk/include/VBox
- Timestamp:
- Mar 4, 2009 6:10:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/xml.h
r16539 r17362 139 139 { 140 140 public: 141 142 141 XmlError(xmlErrorPtr aErr); 143 142 … … 151 150 { 152 151 public: 153 154 ENotImplemented (const char *aMsg = NULL) : LogicError (aMsg) {} 155 ENotImplemented (RT_SRC_POS_DECL) : LogicError (RT_SRC_POS_ARGS) {} 152 ENotImplemented(const char *aMsg = NULL) : LogicError(aMsg) {} 153 ENotImplemented(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {} 156 154 }; 157 155 … … 159 157 { 160 158 public: 161 162 EInvalidArg (const char *aMsg = NULL) : LogicError (aMsg) {} 163 EInvalidArg (RT_SRC_POS_DECL) : LogicError (RT_SRC_POS_ARGS) {} 159 EInvalidArg(const char *aMsg = NULL) : LogicError(aMsg) {} 160 EInvalidArg(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {} 161 }; 162 163 class VBOXXML_CLASS EDocumentNotEmpty : public LogicError 164 { 165 public: 166 EDocumentNotEmpty(const char *aMsg = NULL) : LogicError(aMsg) {} 167 EDocumentNotEmpty(RT_SRC_POS_DECL) : LogicError(RT_SRC_POS_ARGS) {} 164 168 }; 165 169 … … 170 174 { 171 175 public: 172 173 ENoMemory (const char *aMsg = NULL) : RuntimeError (aMsg) {} 176 ENoMemory(const char *aMsg = NULL) : RuntimeError (aMsg) {} 174 177 virtual ~ENoMemory() throw() {} 175 178 }; … … 321 324 322 325 /** 323 * Destr roys the File object. If the object was created from a file name326 * Destroys the File object. If the object was created from a file name 324 327 * the corresponding file will be automatically closed. If the object was 325 328 * created from a file handle, it will remain open. … … 418 421 419 422 /* 420 * Node 421 * 423 * Node: 424 * an XML node, which represents either an element or an attribute. 425 * 426 * For elements, getName() returns the element name, and getValue() 427 * returns the text contents, if any. 428 * 429 * For attributes, getName() returns the attribute name, and getValue() 430 * returns the attribute value, if any. 431 * 432 * Since the default constructor is private, one can create new nodes 433 * only through factory methods provided by the XML classes. These are: 434 * 435 * -- xml::Document::createRootElement() 436 * -- xml::Node::createChild() 437 * -- xml::Node::setAttribute() 422 438 */ 423 439 … … 428 444 { 429 445 public: 430 Node();431 446 ~Node(); 432 447 … … 451 466 bool getAttributeValue(const char *pcszMatch, uint64_t &i) const; 452 467 453 private: 468 Node* createChild(const char *pcszElementName); 469 Node* setAttribute(const char *pcszName, const char *pcszValue); 470 471 private: 472 // hide the default constructor so people use only our factory methods 473 Node(); 474 454 475 friend class Document; 455 476 friend class XmlFileParser; … … 477 498 478 499 private: 500 /* Obscure class data */ 479 501 struct Data; 480 502 Data *m; … … 491 513 Document(); 492 514 ~Document(); 515 493 516 Document(const Document &x); 494 517 Document& operator=(const Document &x); … … 496 519 const Node* getRootElement() const; 497 520 521 Node* createRootElement(const char *pcszRootElementName); 522 498 523 private: 499 524 friend class XmlFileParser; 525 friend class XmlFileWriter; 500 526 501 527 void refreshInternals(); … … 539 565 540 566 static int ReadCallback(void *aCtxt, char *aBuf, int aLen); 541 542 567 static int CloseCallback (void *aCtxt); 543 568 }; 544 569 545 570 /* 571 * XmlFileWriter 572 * 573 */ 574 575 class VBOXXML_CLASS XmlFileWriter 576 { 577 public: 578 XmlFileWriter(Document &doc); 579 ~XmlFileWriter(); 580 581 void write(const char *pcszFilename); 582 583 static int WriteCallback(void *aCtxt, const char *aBuf, int aLen); 584 static int CloseCallback (void *aCtxt); 585 586 private: 587 /* Obscure class data */ 588 struct Data; 589 Data *m; 590 }; 546 591 547 592 #if defined(_MSC_VER)
Note:
See TracChangeset
for help on using the changeset viewer.