当前位置: 首页>>代码示例>>C++>>正文


C++ CXmlNode::GetName方法代码示例

本文整理汇总了C++中CXmlNode::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode::GetName方法的具体用法?C++ CXmlNode::GetName怎么用?C++ CXmlNode::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CXmlNode的用法示例。


在下文中一共展示了CXmlNode::GetName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetAliases

//----------------------------------------------------
bool CAliasesDictionary::GetAliases(CProduct* product)
{
  if (product == NULL)
  {
    return false;
  }
  CXmlNode* productNode = this->FindProductNode(product->GetProductClass());

  if (productNode == NULL)
  {
    return false;
  }

  CXmlNode* child = productNode->GetChildren();
  
  while (child != NULL) 
  {
    if (!str_icmp(child->GetName(), CAliasesDictionary::m_PRODUCT_ELT))
    {
      child = child->GetNext();
      continue;
    }

    child = child->GetNext();
  }

  return true;

}
开发者ID:BRAT-DEV,项目名称:main,代码行数:30,代码来源:AliasesDictionary.cpp

示例2: GetNameSpaces

CString CXmlDocument::GetNameSpaces()
{
	CString cstr,xpath,name,ns;
	int at;
	long count;
	count = m_pDoc->namespaces->length;
	CXmlNode node;
	for(long i =0;i<count;++i)
	{
		ns = (LPCTSTR)m_pDoc->namespaces->namespaceURI[i];
		xpath.Format(_T("//*[namespace-uri()='%s']"),ns);
		node = this->Find(xpath);
		if(node.IsValid())
		{
			name = node.GetName();
			if((at=name.Find(_T(":"),0))>=0)
			{
				if(!cstr.IsEmpty()) cstr += _T(" ");
				cstr.AppendFormat(_T("xmlns:%s='%s'"),name.Left(at),ns);
			}
		}

	}
	return cstr;
}
开发者ID:firememory,项目名称:BuddyDesk,代码行数:25,代码来源:Util_XMLDOM.cpp

示例3: Parse

void SectionDescriptor::Parse()
{
    if ( !GetNode()->HasProp(TYPE_ATTR) ) {
        throw wxString::Format(DESCRIPTOR_WRONG_XML + wxString("  %s"), wxString(GetNode()->GetName()));
    }
    m_type = new wxString(GetNode()->GetPropVal(TYPE_ATTR, ""));

    CXmlNode* current = GetNode()->GetChildren();
    while ( NULL != current ) {
        if ( wxString(current->GetName()).Cmp(COMPOSER_FIELD_ATTR) == 0 ) {
            SectionFieldDescriptor* elem = new SectionFieldDescriptor(*current);
            m_fields.push_back(elem);
        }
        current = current->GetNext();
    }
}
开发者ID:Skier,项目名称:vault_repo,代码行数:16,代码来源:ComposerDescriptor.cpp

示例4: FindAliasNode

//----------------------------------------------------
CXmlNode* CAliasesDictionary::FindAliasNode(const std::string& name, CXmlNode* parent, bool allDepths /* = false */)
{
  if (parent == NULL)
  {
    return NULL;
  }

  CXmlNode* child =  parent->GetChildren();
  std::string value;

  while (child != NULL)
  {
    if (str_icmp(child->GetName(), CAliasesDictionary::m_ALIAS_ELT))
    {
      bool bOk = child->GetPropVal(CAliasesDictionary::m_NAME_ATTR, &value);
      if (bOk)
      {
        if (str_icmp(name, value))
        {
          break;
        }
      }
    }

    if ((allDepths) && (child->GetChildren() != NULL))
    {
      CXmlNode* newChild = FindAliasNode(name, child, allDepths);
      
      if (newChild != NULL)
      {
        child = newChild;
        break;
      }
    }

    child = child->GetNext();
  }

  return child;

}
开发者ID:BRAT-DEV,项目名称:main,代码行数:42,代码来源:AliasesDictionary.cpp

示例5: LoadElem

CElem* CXMLVecLS::LoadElem(CXmlNode &node)
{
	CString str;
	int nType = GetType(node.GetName());

	CPointF pt;
	CRectF rc; 

	CElem *elem = NULL;
	switch (nType)
	{
	case CElem::Line:
		{		
			CLine *pElem = new CLine();
			
			TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);
 
			pt.x = node.GetFloatAttrib(_T("StartPointX"));
			pt.y = node.GetFloatAttrib(_T("StartPointY"));
			pElem->SetStartPoint(pt);

			pt.x = node.GetFloatAttrib(_T("EndPointX"));
			pt.y = node.GetFloatAttrib(_T("EndPointY")); 
			pElem->SetEndPoint(pt);
			elem = pElem;
		}
		break;
	case CElem::Bezier:
		{		
			CBezier *pElem = new CBezier();
			
			TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);

			CXmlNode n;
			CPointF pt;
			CFPoints pts;
			for (int i=0,cnt=node.ChildCount; i<cnt; ++i)
			{
				n = node.Child[i];
				if (n.GetName() == _T("Point"))
				{
					pt.x = n.GetFloatAttrib(_T("X"));
					pt.y = n.GetFloatAttrib(_T("Y"));
					pts.Add(pt);
				}
			}
			pElem->SetPoints(pts);
			elem = pElem;
		}
		break;
	case CElem::FreeLine:
		{		
			CFreeLine *pElem = new CFreeLine();
			
			TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);

			CXmlNode n;
			CPointF pt;
			CFPoints pts;
			for (int i=0,cnt=node.ChildCount; i<cnt; ++i)
			{
				n = node.Child[i];
				if (n.GetName() == _T("Point"))
				{
					pt.x = n.GetFloatAttrib(_T("X"));
					pt.y = n.GetFloatAttrib(_T("Y"));
					pts.Add(pt);
				}
			}
			pElem->SetPoints(pts);
			elem = pElem;
		}
		break;
	case CElem::Arc:
		{
			CArc *pElem = new CArc();
			
			TEST_FREE_RETURNNULL(!LoadNonFillVecElem(pElem,node),pElem);

			rc.left = node.GetFloatAttrib(_T("RectLeft"));
			rc.top = node.GetFloatAttrib(_T("RectTop"));
			rc.right = node.GetFloatAttrib(_T("RectRight"));			
			rc.bottom = node.GetFloatAttrib(_T("RectBottom"));
			pElem->SetBoundsRect(rc);

			pElem->SetStartAngel(node.GetFloatAttrib(_T("StartAngel")));
			pElem->SetEndAngel(node.GetFloatAttrib(_T("EndAngel")));

			elem = pElem;
		}
		break;
	case CElem::Chord:
		{
			CChord *pElem = new CChord();
			
			TEST_FREE_RETURNNULL(!LoadFilledVecElem(pElem,node),pElem);

			rc.left = node.GetFloatAttrib(_T("RectLeft"));
			rc.top = node.GetFloatAttrib(_T("RectTop"));
			rc.right = node.GetFloatAttrib(_T("RectRight"));			
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的CXmlNode::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。