當前位置: 首頁>>代碼示例>>C++>>正文


C++ FirstChild函數代碼示例

本文整理匯總了C++中FirstChild函數的典型用法代碼示例。如果您正苦於以下問題:C++ FirstChild函數的具體用法?C++ FirstChild怎麽用?C++ FirstChild使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FirstChild函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: FirstChildElement

const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const
{
	const TiXmlNode* node;

	for (	node = FirstChild( _value );
			node;
			node = node->NextSibling( _value ) )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
開發者ID:hjhong,項目名稱:MyDuiLib,代碼行數:13,代碼來源:tinyxml.cpp

示例2: FirstChildElement

TiXmlElement* TiXmlNode::FirstChildElement()
{
	TiXmlNode* node;

	for (	node = FirstChild();
			node;
			node = node->NextSibling() )
	{
		if ( node->ToElement() )
			return node->ToElement();
	}
	return 0;
}
開發者ID:EQ4,項目名稱:LittleGPTracker,代碼行數:13,代碼來源:tinyxml.cpp

示例3: StreamOut

void TiXmlDocument::StreamOut( TIXML_OSTREAM * out ) const
{
	TiXmlNode* node;
	for ( node=FirstChild(); node; node=node->NextSibling() )
	{
		node->StreamOut( out );

		// Special rule for streams: stop after the root element.
		// The stream in code will only read one element, so don't
		// write more than one.
		if ( node->ToElement() )
			break;
	}
}
開發者ID:hhypgfadwr,項目名稱:nppPluginManager,代碼行數:14,代碼來源:tinyxml.cpp

示例4: Accept

	bool XMLDocument::Accept(XMLVisitor* visitor) const
	{
		if (visitor->VisitEnter(*this))
		{
			for (const XMLNode* node = FirstChild(); node; node = node->NextSibling())
			{
				if (!node->Accept(visitor))
				{
					break;
				}
			}
		}
		return visitor->VisitExit(*this);
	}
開發者ID:CooperCoders,項目名稱:GraphicsProject,代碼行數:14,代碼來源:tinyxml2.cpp

示例5: FirstChild

const char * XmlNode::GetText() const
{
	const TiXmlNode * childNode = FirstChild();
	if ( childNode == NULL )
	{
		return NULL;
	}
	IE_ASSERT( childNode->Type() == TEXT );

	const TiXmlText * text = childNode->ToText();
	IE_ASSERT( text );

	return text->Value();
}
開發者ID:markisme,項目名稱:healthcare,代碼行數:14,代碼來源:XMLLib.cpp

示例6: LeafRef

void XMLParagraph::DeleteLeaf(size_t nLeaf)
{
    auto pNode   = LeafRef(nLeaf).Node();
    auto pParent = pNode->Parent();

    while(pParent && (pParent->FirstChild() == pParent->LastChild())){
        pNode   = pParent;
        pParent = pParent->Parent();
    }

    if(pParent){
        pParent->DeleteChild(pNode);
    }
}
開發者ID:etorth,項目名稱:mir2x,代碼行數:14,代碼來源:xmlparagraph.cpp

示例7: BuildCookieEditorListL

void CookiePath::BuildCookieEditorListL(CookieDomain* domain)
{
	Cookie *ck = (Cookie*)cookie_list.First();
	if( ck )
	{
		ck->BuildCookieEditorListL(domain, this);
	}
	
	CookiePath *cp = (CookiePath*)FirstChild();
	while(cp)
	{
		cp->BuildCookieEditorListL(domain);
		cp = cp->Suc();
	}
}
開發者ID:prestocore,項目名稱:browser,代碼行數:15,代碼來源:url_cmp.cpp

示例8: FirstChild

	Node * Node::FindEditChildByAttrib (	std::string const & childName, 
											std::string const & attrName, 
											std::string const & attrValue)
	{
		XML::Node::ChildIter it = FirstChild ();
		XML::Node::ChildIter last = LastChild ();
		while (it != last)
		{
			XML::Node * child = *it;
			if (child->GetName () == childName && child->FindAttribValue (attrName) == attrValue)
				return child;
			++it;
		}
		return 0;
	}
開發者ID:dbremner,項目名稱:WinLib,代碼行數:15,代碼來源:XmlTree.cpp

示例9: while

void CookiePath::IterateAllCookies()
{
	Cookie* ck = static_cast<Cookie*>( cookie_list.First() );
	OpCookieIteratorListener* listener = g_cookie_API->GetCookieIteratorListener();
	while( ck )
	{
		listener->OnIterateCookies(*ck);
		ck = ck->Suc();
	}

	CookiePath* cp = static_cast<CookiePath*>( FirstChild() );
	while (cp)
	{
		cp->IterateAllCookies();
		cp = cp->Suc();
	}
}
開發者ID:prestocore,項目名稱:browser,代碼行數:17,代碼來源:url_cmp.cpp

示例10: Printe

int TiXmlDocument::Printe( char * xmlstr, int totallen, int depth, int& len ) 
{
	char tempstr[MAX_XML_SIZE] = {0};
	TiXmlNode* node = NULL;
	for ( node = FirstChild(); node; node = node->NextSibling() )
	{
		//#ifdef _PUTSTRING
		if ( node->Printe( xmlstr, totallen, depth, len ) < 0 )
		{
			return -2;
		}
		//#endif
		sprintf( tempstr, "\n" );
		SAFE_STRCAT;
	}

	return 0;
}
開發者ID:crashatom,項目名稱:phoebemail,代碼行數:18,代碼來源:tinyxmlplus.cpp

示例11: sizeof

void CookiePath::GetMemUsed(DebugUrlMemory &debug)
{
	debug.memory_cookies += sizeof(*this) + path.Length();

	Cookie *ck = (Cookie *) cookie_list.First();
	while(ck)
	{
		ck->GetMemUsed(debug);
		ck = ck->Suc();
	}

	CookiePath *cp = (CookiePath *) FirstChild();
	while(cp)
	{
		cp->GetMemUsed(debug);
		cp = cp->Suc();
	}
}
開發者ID:prestocore,項目名稱:browser,代碼行數:18,代碼來源:url_cmp.cpp

示例12: NS_PRECONDITION

nsFrameList::Slice
nsFrameList::InsertFrames(nsIFrame* aParent, nsIFrame* aPrevSibling,
                          nsFrameList& aFrameList)
{
  NS_PRECONDITION(aFrameList.NotEmpty(), "Unexpected empty list");

  if (aParent) {
    aFrameList.ApplySetParent(aParent);
  }

  NS_ASSERTION(IsEmpty() ||
               FirstChild()->GetParent() == aFrameList.FirstChild()->GetParent(),
               "frame to add has different parent");
  NS_ASSERTION(!aPrevSibling ||
               aPrevSibling->GetParent() == aFrameList.FirstChild()->GetParent(),
               "prev sibling has different parent");
#ifdef DEBUG_FRAME_LIST
  // ContainsFrame is O(N)
  NS_ASSERTION(!aPrevSibling || ContainsFrame(aPrevSibling),
               "prev sibling is not on this list");
#endif

  nsIFrame* firstNewFrame = aFrameList.FirstChild();
  nsIFrame* nextSibling;
  if (aPrevSibling) {
    nextSibling = aPrevSibling->GetNextSibling();
    aPrevSibling->SetNextSibling(firstNewFrame);
  }
  else {
    nextSibling = mFirstChild;
    mFirstChild = firstNewFrame;
  }

  nsIFrame* lastNewFrame = aFrameList.LastChild();
  lastNewFrame->SetNextSibling(nextSibling);
  if (!nextSibling) {
    mLastChild = lastNewFrame;
  }

  VerifyList();

  aFrameList.Clear();
  return Slice(*this, firstNewFrame, nextSibling);
}
開發者ID:at13,項目名稱:mozilla-central,代碼行數:44,代碼來源:nsFrameList.cpp

示例13: fprintf

void CookiePath::DebugWriteCookies(FILE* fp)
{
	fprintf(fp, "   ");
	DebugWritePath(fp);
	fprintf(fp, ": \n");
	Cookie* ck = (Cookie*) cookie_list.First();
	while (ck)
	{
		fprintf(fp, "      %s=%s; %lu; %d; %lu %s\n", ck->Name(), ck->Value(), ck->Expires(), ck->Secure(), ck->GetLastUsed(), (ck->DiscardAtExit() ? "; Discard on exit" : ""));
		ck = ck->Suc();
	}

	CookiePath* cp = (CookiePath*) FirstChild();
	while (cp)
	{
		cp->DebugWriteCookies(fp);
		cp = cp->Suc();
	}
}
開發者ID:prestocore,項目名稱:browser,代碼行數:19,代碼來源:url_cmp.cpp

示例14: FirstChild

NS_IMETHODIMP
inDeepTreeWalker::NextNode(nsIDOMNode **_retval)
{
  // First try our kids
  FirstChild(_retval);

  if (*_retval) {
    return NS_OK;
  }

  // Now keep trying next siblings up the parent chain, but if we
  // discover there's nothing else restore our state.
#ifdef DEBUG
  nsIDOMNode* origCurrentNode = mCurrentNode;
#endif
  uint32_t lastChildCallsToMake = 0;
  while (1) {
    NextSibling(_retval);

    if (*_retval) {
      return NS_OK;
    }

    nsCOMPtr<nsIDOMNode> parent;
    ParentNode(getter_AddRefs(parent));
    if (!parent) {
      // Nowhere else to go; we're done.  Restore our state.
      while (lastChildCallsToMake--) {
        nsCOMPtr<nsIDOMNode> dummy;
        LastChild(getter_AddRefs(dummy));
      }
      NS_ASSERTION(mCurrentNode == origCurrentNode,
                   "Didn't go back to the right node?");
      *_retval = nullptr;
      return NS_OK;
    }
    ++lastChildCallsToMake;
  }

  NS_NOTREACHED("how did we get here?");
  return NS_OK;
}
開發者ID:JuannyWang,項目名稱:gecko-dev,代碼行數:42,代碼來源:inDeepTreeWalker.cpp

示例15: WriteOpeningTag

	void Node::Write (std::ostream & out, unsigned indent) const
	{
		WriteOpeningTag (out, indent);
		if (!_closed)
		{
			for (ConstChildIter it = FirstChild (); it != LastChild (); ++it)
			{
				XML::Node * child = *it;
				if (child->GetName ().empty ()) // text
				{
					out << Indentation (indent) << child->GetAttribValue ("Text") << std::endl;
				}
				else
				{
					child->Write (out, indent + 2);
				}
			}
		}
		WriteClosingTag (out, indent);
	}
開發者ID:dbremner,項目名稱:WinLib,代碼行數:20,代碼來源:XmlTree.cpp


注:本文中的FirstChild函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。