本文整理汇总了C++中lliopipe::buffer_ptr_t::get方法的典型用法代码示例。如果您正苦于以下问题:C++ buffer_ptr_t::get方法的具体用法?C++ buffer_ptr_t::get怎么用?C++ buffer_ptr_t::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lliopipe::buffer_ptr_t
的用法示例。
在下文中一共展示了buffer_ptr_t::get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: completedRaw
void exoFlickrResponse::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 = strstrm.str();
Json::Value root;
Json::Reader reader;
bool success = reader.parse(result, root);
if(!success)
{
mCallback(false, LLSD());
return;
}
else
{
LL_INFOS("FlickrAPI") << "Got response string: " << result << LL_ENDL;
LLSD response;
JsonToLLSD(root, response);
mCallback(isGoodStatus(status), response);
}
}
示例2: completedRaw
void EmeraldDicDownloader::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer)
{
if (status < 200 || status >= 300)
{
return;
}
LLBufferStream istr(channels, buffer.get());
std::string dicpath(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", name.c_str()));
llofstream ostr(dicpath, std::ios::binary);
while (istr.good() && ostr.good())
{
ostr << istr.rdbuf();
}
ostr.close();
if (panel)
{
if (panel->empanel)
{
panel->empanel->refresh();
}
else
{
llinfos << "completedRaw(): No empanel to refresh()!" << llendl;
}
panel->close();
}
}
示例3: completedRaw
virtual void completedRaw(U32 status,
const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
if (!isGoodStatus(status))
{
llinfos << mURL << " [" << status << "]: " << reason << llendl;
if (mURL == legacy_client_list)
{
LL_WARNS("ClientTags") << "client_list_v2.xml download failed with status of " << status << LL_ENDL;
// Wolfspirit: If something failes, try to use the local file
FSData::getInstance()->updateClientTagsLocal();
}
return;
}
LLSD content;
LLBufferStream istr(channels, buffer.get());
if (!LLSDSerialize::fromXML(content, istr))
{
llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
if (mURL == legacy_client_list)
{
LL_WARNS("ClientTags") << "Downloaded client_list_v2.xml decode failed." << LL_ENDL;
// Wolfspirit: If something failes, try to use the local file
FSData::getInstance()->updateClientTagsLocal();
}
return;
}
FSData::getInstance()->processResponder(content, mURL);
}
示例4: completedRaw
void exoFlickrAuthResponse::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer)
{
LLBufferStream istr(channels, buffer.get());
std::ostringstream oss;
oss << istr.rdbuf();
std::string str = oss.str();
LLSD result = LLURI::queryMap(str);
mCallback((status == 200), result);
}
示例5: istr
// virtual
void LLCurl::Responder::completedRaw(
U32 status,
const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
LLSD content;
LLBufferStream istr(channels, buffer.get());
LLSDSerialize::fromXML(content, istr);
completed(status, reason, content);
}
示例6: completedRaw
void ModularSystemsDownloader::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());
mCallback(status, result);
}
示例7: istr
// virtual
void LLCurl::Responder::completedRaw(
U32 status,
const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
LLSD content;
LLBufferStream istr(channels, buffer.get());
if (!LLSDSerialize::fromXML(content, istr))
{
llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
}
completed(status, reason, content);
}
示例8: istr
/*virtual*/ void 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();
const std::string body = strstrm.str();
if (status != 200)
{
llwarns << "Failed to get upload config (" << status << ")" << llendl;
LLWebProfile::reportImageUploadStatus(false);
return;
}
Json::Value root;
Json::Reader reader;
if (!reader.parse(body, root))
{
llwarns << "Failed to parse upload config: " << reader.getFormatedErrorMessages() << llendl;
LLWebProfile::reportImageUploadStatus(false);
return;
}
// *TODO: 404 = not supported by the grid
// *TODO: increase timeout or handle 499 Expired
// Convert config to LLSD.
const Json::Value data = root["data"];
const std::string upload_url = root["url"].asString();
LLSD config;
config["acl"] = data["acl"].asString();
config["AWSAccessKeyId"] = data["AWSAccessKeyId"].asString();
config["Content-Type"] = data["Content-Type"].asString();
config["key"] = data["key"].asString();
config["policy"] = data["policy"].asString();
config["success_action_redirect"] = data["success_action_redirect"].asString();
config["signature"] = data["signature"].asString();
config["add_loc"] = data.get("add_loc", "0").asString();
config["caption"] = data.get("caption", "").asString();
// Do the actual image upload using the configuration.
LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
LLWebProfile::post(mImagep, config, upload_url);
}
示例9: istr
// virtual
void LLCurl::Responder::completedRaw(
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
LLBufferStream istr(channels, buffer.get());
const bool emit_parse_errors = false;
// <Techwolf Lupindo> pass parse error down code path
mDeserializeError = false;
std::string debug_body("(empty)");
bool parsed=true;
if (EOF == istr.peek())
{
parsed=false;
}
// Try to parse body as llsd, no matter what 'content-type' says.
else if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(mContent, istr, emit_parse_errors))
{
parsed=false;
char body[1025];
body[1024] = '\0';
istr.seekg(0, std::ios::beg);
istr.get(body,1024);
if (strlen(body) > 0)
{
mContent = body;
debug_body = body;
}
// <Techwolf Lupindo> pass parse error down code path
mDeserializeError = true;
}
// Only emit a warning if we failed to parse when 'content-type' == 'application/llsd+xml'
if (!parsed && (HTTP_CONTENT_LLSD_XML == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE)))
{
LL_WARNS() << "Failed to deserialize . " << mURL << " [status:" << mStatus << "] "
<< "(" << mReason << ") body: " << debug_body << LL_ENDL;
}
httpCompleted();
}