本文整理汇总了C++中CXmlNode::GetAttributeLong方法的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode::GetAttributeLong方法的具体用法?C++ CXmlNode::GetAttributeLong怎么用?C++ CXmlNode::GetAttributeLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CXmlNode
的用法示例。
在下文中一共展示了CXmlNode::GetAttributeLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void CQuotes::Init(const CString& strXml)
{
try
{
CXmlDocument doc;
doc.LoadXml(strXml);
CXmlNodeList secList = doc.Select(_T("/buddy/s"));
for (int i = 0; i < secList.GetLength(); i++)
{
CXmlNode ndSec = secList.GetItem(i);
m_strId = ndSec.GetAttribute(_T("code"));
m_eMarket = (MarketType)ndSec.GetAttributeLong(_T("market"));
QuoteType eType = (QuoteType)ndSec.GetAttributeLong(_T("type"));
CXmlNodeList quoteList = ndSec.Select(_T("q"));
for (int j = 0; j < quoteList.GetLength(); j++)
{
Quote quote;
CXmlNode ndQuote = quoteList.GetItem(i);
CString strDate = ndQuote.GetAttribute(_T("t"));
quote.dtTime.ParseDateTime((LPCTSTR)strDate.GetBuffer());
quote.eQuote = eType;
quote.dOpen = ndQuote.GetAttributeDouble(_T("o"));
quote.dHigh = ndQuote.GetAttributeDouble(_T("h"));
quote.dLow = ndQuote.GetAttributeDouble(_T("l"));
quote.dClose = ndQuote.GetAttributeDouble(_T("c"));
quote.dVolumn = ndQuote.GetAttributeDouble(_T("v"));
quote.dAmount = ndQuote.GetAttributeDouble(_T("a"));
m_vecQuote.push_back(quote);
}
}
}
catch( ... )
{
OutputDebugString(_T("parse quote failed."));
}
return;
}