Changeset 49028 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Oct 10, 2013 12:55:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/xml.h
r48862 r49028 399 399 const char *getPrefix() const; 400 400 const char *getNamespaceURI() const; 401 bool nameEquals (const char *pcszNamespace, const char *pcsz) const;401 bool nameEqualsNS(const char *pcszNamespace, const char *pcsz) const; 402 402 bool nameEquals(const char *pcsz) const 403 403 { 404 return nameEquals (NULL, pcsz);405 } 406 bool nameEqualsN(const char *pcsz Namespace, const char *pcsz, size_t cchMax) const;404 return nameEqualsNS(NULL, pcsz); 405 } 406 bool nameEqualsN(const char *pcsz, size_t cchMax, const char *pcszNamespace = NULL) const; 407 407 408 408 const char *getValue() const; … … 534 534 AttributeNode(const AttributeNode &x); // no copying 535 535 536 /** For storing attribute names with namespace prefix.537 * Only used if with non-default namespace specified. */538 RTCString m_strKey;539 540 536 friend class Node; 541 537 friend class ElementNode; … … 557 553 { 558 554 public: 559 int getChildElements(ElementNodesList &children, 560 const char *pcszMatch = NULL) const; 561 562 const ElementNode *findChildElement(const char *pcszNamespace, 563 const char *pcszMatch) const; 555 int getChildElements(ElementNodesList &children, const char *pcszMatch = NULL) const; 556 557 const ElementNode *findChildElementNS(const char *pcszNamespace, const char *pcszMatch) const; 564 558 const ElementNode *findChildElement(const char *pcszMatch) const 565 559 { 566 return findChildElement (NULL, pcszMatch);560 return findChildElementNS(NULL, pcszMatch); 567 561 } 568 562 const ElementNode *findChildElementFromId(const char *pcszId) const; … … 610 604 * (default) match any namespace. When using a 611 605 * path, this matches all elements along the way. 606 * @param pcszAttribNamespace The namespace prefix to apply to the attribute, 607 * NULL (default) match any namespace. 612 608 * @see findChildElementP and findAttributeValue 613 609 */ 614 610 const char *findChildElementAttributeValueP(const char *pcszPath, const char *pcszAttribute, 615 const char *pcszPathNamespace = NULL) const 611 const char *pcszPathNamespace = NULL, 612 const char *pcszAttributeNamespace = NULL) const 616 613 { 617 614 const ElementNode *pElem = findChildElementP(pcszPath, pcszPathNamespace); 618 615 if (pElem) 619 return pElem->findAttributeValue(pcszAttribute );616 return pElem->findAttributeValue(pcszAttribute, pcszAttributeNamespace); 620 617 return NULL; 621 618 } … … 695 692 696 693 697 const AttributeNode *findAttribute(const char *pcszMatch ) const;694 const AttributeNode *findAttribute(const char *pcszMatch, const char *pcszNamespace = NULL) const; 698 695 /** Find the first attribute with the given name, returning its value string. 699 696 * @returns Pointer to the attribute string value. 700 697 * @param pcszName The attribute name. 698 * @param pcszNamespace The namespace name, default is NULL which means 699 * anything goes. 701 700 * @see getAttributeValue 702 701 */ 703 const char *findAttributeValue(const char *pcszName ) const704 { 705 const AttributeNode *pAttr = findAttribute(pcszName );702 const char *findAttributeValue(const char *pcszName, const char *pcszNamespace = NULL) const 703 { 704 const AttributeNode *pAttr = findAttribute(pcszName, pcszNamespace); 706 705 if (pAttr) 707 706 return pAttr->getValue(); … … 709 708 } 710 709 711 bool getAttributeValue(const char *pcszMatch, const char *&pcsz) const { return getAttributeValue(pcszMatch, &pcsz); } 712 bool getAttributeValue(const char *pcszMatch, RTCString &str) const; 713 bool getAttributeValuePath(const char *pcszMatch, RTCString &str) const; 714 bool getAttributeValue(const char *pcszMatch, int32_t &i) const; 715 bool getAttributeValue(const char *pcszMatch, uint32_t &i) const; 716 bool getAttributeValue(const char *pcszMatch, int64_t &i) const { return getAttributeValue(pcszMatch, &i); } 717 bool getAttributeValue(const char *pcszMatch, uint64_t &i) const; 718 bool getAttributeValue(const char *pcszMatch, bool &f) const; 710 bool getAttributeValue(const char *pcszMatch, const char *&pcsz, const char *pcszNamespace = NULL) const 711 { return getAttributeValue(pcszMatch, &pcsz, pcszNamespace); } 712 bool getAttributeValue(const char *pcszMatch, RTCString &str, const char *pcszNamespace = NULL) const 713 { return getAttributeValue(pcszMatch, &str, pcszNamespace); } 714 bool getAttributeValuePath(const char *pcszMatch, RTCString &str, const char *pcszNamespace = NULL) const 715 { return getAttributeValue(pcszMatch, &str, pcszNamespace); } 716 bool getAttributeValue(const char *pcszMatch, int32_t &i, const char *pcszNamespace = NULL) const 717 { return getAttributeValue(pcszMatch, &i, pcszNamespace); } 718 bool getAttributeValue(const char *pcszMatch, uint32_t &i, const char *pcszNamespace = NULL) const 719 { return getAttributeValue(pcszMatch, &i, pcszNamespace); } 720 bool getAttributeValue(const char *pcszMatch, int64_t &i, const char *pcszNamespace = NULL) const 721 { return getAttributeValue(pcszMatch, &i, pcszNamespace); } 722 bool getAttributeValue(const char *pcszMatch, uint64_t &u, const char *pcszNamespace = NULL) const 723 { return getAttributeValue(pcszMatch, &u, pcszNamespace); } 724 bool getAttributeValue(const char *pcszMatch, bool &f, const char *pcszNamespace = NULL) const 725 { return getAttributeValue(pcszMatch, &f, pcszNamespace); } 719 726 720 727 /** @name Variants that for clarity does not use references for output params. 721 728 * @{ */ 722 bool getAttributeValue(const char *pcszMatch, const char **ppcsz ) const;723 bool getAttributeValue(const char *pcszMatch, RTCString *pStr ) const { return getAttributeValue(pcszMatch, *pStr); }724 bool getAttributeValuePath(const char *pcszMatch, RTCString *pStr ) const { return getAttributeValuePath(pcszMatch, *pStr); }725 bool getAttributeValue(const char *pcszMatch, int32_t *pi ) const { return getAttributeValue(pcszMatch, *pi); }726 bool getAttributeValue(const char *pcszMatch, uint32_t *pu ) const { return getAttributeValue(pcszMatch, *pu); }727 bool getAttributeValue(const char *pcszMatch, int64_t *piValue ) const;728 bool getAttributeValue(const char *pcszMatch, uint64_t *pu ) const { return getAttributeValue(pcszMatch, *pu); }729 bool getAttributeValue(const char *pcszMatch, bool *pf ) const { return getAttributeValue(pcszMatch, *pf); }729 bool getAttributeValue(const char *pcszMatch, const char **ppcsz, const char *pcszNamespace = NULL) const; 730 bool getAttributeValue(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace = NULL) const; 731 bool getAttributeValuePath(const char *pcszMatch, RTCString *pStr, const char *pcszNamespace = NULL) const; 732 bool getAttributeValue(const char *pcszMatch, int32_t *pi, const char *pcszNamespace = NULL) const; 733 bool getAttributeValue(const char *pcszMatch, uint32_t *pu, const char *pcszNamespace = NULL) const; 734 bool getAttributeValue(const char *pcszMatch, int64_t *piValue, const char *pcszNamespace = NULL) const; 735 bool getAttributeValue(const char *pcszMatch, uint64_t *pu, const char *pcszNamespace = NULL) const; 736 bool getAttributeValue(const char *pcszMatch, bool *pf, const char *pcszNamespace = NULL) const; 730 737 /** @} */ 731 738
Note:
See TracChangeset
for help on using the changeset viewer.