本文整理汇总了C++中LLXmlTreeNode::getAttributeString方法的典型用法代码示例。如果您正苦于以下问题:C++ LLXmlTreeNode::getAttributeString方法的具体用法?C++ LLXmlTreeNode::getAttributeString怎么用?C++ LLXmlTreeNode::getAttributeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLXmlTreeNode
的用法示例。
在下文中一共展示了LLXmlTreeNode::getAttributeString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: completedRaw
void exoFlickrUploadResponse::completedRaw(
U32 status,
const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
LLBufferStream istr(channels, buffer.get());
std::stringstream strstrm;
strstrm << istr.rdbuf();
std::string result = std::string(strstrm.str());
LLSD output;
bool success;
LLXmlTree tree;
if(!tree.parseString(result))
{
LL_WARNS("FlickrAPI") << "Couldn't parse flickr response(" << status << "): " << result << LL_ENDL;
mCallback(false, LLSD());
return;
}
LLXmlTreeNode* root = tree.getRoot();
if(!root->hasName("rsp"))
{
LL_WARNS("FlickrAPI") << "Bad root node: " << root->getName() << LL_ENDL;
mCallback(false, LLSD());
return;
}
std::string stat;
root->getAttributeString("stat", stat);
output["stat"] = stat;
if(stat == "ok")
{
success = true;
LLXmlTreeNode* photoid_node = root->getChildByName("photoid");
if(photoid_node)
{
output["photoid"] = photoid_node->getContents();
}
}
else
{
success = false;
LLXmlTreeNode* err_node = root->getChildByName("err");
if(err_node)
{
S32 code;
std::string msg;
err_node->getAttributeS32("code", code);
err_node->getAttributeString("msg", msg);
output["code"] = code;
output["msg"] = msg;
}
}
mCallback(success, output);
}