vbox的更動 48797 路徑 trunk/src/VBox/Runtime/r3
- 時間撮記:
- 2013-10-1 下午02:43:17 (11 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/xml.cpp
r48785 r48797 864 864 } 865 865 866 /** 867 * Recursively find the first matching child element. 868 * 869 * @returns child element or NULL if not found. 870 * @param pcszNamespace The Namespace prefix or NULL. 871 * @param pcszPath Simple element path, with parent and child elements 872 * separated by a forward slash ('/'). 873 */ 874 const ElementNode *ElementNode::findChildElementDeep(const char *pcszNamespace, const char *pcszPath) const 866 867 const ElementNode *ElementNode::findChildElementP(const char *pcszPath, const char *pcszNamespace /*= NULL*/) const 875 868 { 876 869 size_t cchThis = strchr(pcszPath, '/') - pcszPath; … … 889 882 if (pElm->nameEqualsN(pcszNamespace, pcszPath, cchThis)) 890 883 { 891 pElm = findChildElement Deep(pcszNamespace, pcszPath + cchThis);884 pElm = findChildElementP(pcszPath + cchThis, pcszNamespace); 892 885 if (pElm) 893 886 return pElm; … … 904 897 if (pElm->nameEqualsN(pcszNamespace, pcszPath, cchThis)) 905 898 { 906 pElm = findChildElement Deep(pcszNamespace, pcszPath + cchThis);899 pElm = findChildElementP(pcszPath + cchThis, pcszNamespace); 907 900 if (pElm) 908 901 return pElm; … … 914 907 return NULL; 915 908 } 909 910 const ElementNode *ElementNode::getPrevSibilingElement() const 911 { 912 if (!m_pParent) 913 return NULL; 914 const Node *pSibling = this; 915 for (;;) 916 { 917 pSibling = RTListGetPrevCpp(&m_pParent->m_children, pSibling, const Node, m_childEntry); 918 if (!pSibling) 919 return NULL; 920 if (pSibling->isElement()) 921 return static_cast<const ElementNode *>(pSibling); 922 } 923 } 924 925 const ElementNode *ElementNode::getNextSibilingElement() const 926 { 927 if (!m_pParent) 928 return NULL; 929 const Node *pSibling = this; 930 for (;;) 931 { 932 pSibling = RTListGetNextCpp(&m_pParent->m_children, pSibling, const Node, m_childEntry); 933 if (!pSibling) 934 return NULL; 935 if (pSibling->isElement()) 936 return static_cast<const ElementNode *>(pSibling); 937 } 938 } 939 940 const ElementNode *ElementNode::findPrevSibilingElement(const char *pcszMatch, const char *pcszNamespace /*= NULL*/) const 941 { 942 if (!m_pParent) 943 return NULL; 944 const Node *pSibling = this; 945 for (;;) 946 { 947 pSibling = RTListGetPrevCpp(&m_pParent->m_children, pSibling, const Node, m_childEntry); 948 if (!pSibling) 949 return NULL; 950 if (pSibling->isElement()) 951 { 952 const ElementNode *pElem = static_cast<const ElementNode *>(pSibling); 953 if (pElem->nameEquals(pcszNamespace, pcszMatch)) 954 return pElem; 955 } 956 } 957 } 958 959 const ElementNode *ElementNode::findNextSibilingElement(const char *pcszMatch, const char *pcszNamespace /*= NULL*/) const 960 { 961 if (!m_pParent) 962 return NULL; 963 const Node *pSibling = this; 964 for (;;) 965 { 966 pSibling = RTListGetNextCpp(&m_pParent->m_children, pSibling, const Node, m_childEntry); 967 if (!pSibling) 968 return NULL; 969 if (pSibling->isElement()) 970 { 971 const ElementNode *pElem = static_cast<const ElementNode *>(pSibling); 972 if (pElem->nameEquals(pcszNamespace, pcszMatch)) 973 return pElem; 974 } 975 } 976 } 977 916 978 917 979 /**
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器