代码拉取完成,页面将自动刷新
#include "ImgUrl.h"
#include "trace_worker.h"
CImgUrl::CImgUrl(const std::string &cosUrl, const std::string &imgUrl)
:m_cosUrl(cosUrl)
,m_imgUrl(imgUrl)
{
}
const std::string &CImgUrl::ImgToCosUrl(std::string &cosImgUrl)
{ trace_worker();
trace_printf("imgUrl.c_str() %s", m_imgUrl.c_str());
if ((m_imgUrl.find("pubinfo") != std::string::npos && m_imgUrl.find("https") != std::string::npos)
|| m_imgUrl.size() <= 0)
{
return m_imgUrl;
}
std::size_t startPos = m_imgUrl.size();
std::size_t endPos = startPos;
for (;;)
{
endPos = m_imgUrl.find_last_of("/", startPos);
cosImgUrl += m_cosUrl + "pubinfo/" + m_imgUrl.substr(endPos + 1, startPos - endPos - 1);
if (endPos == std::string::npos)
{
break;
}
startPos = m_imgUrl.find_last_of(';', endPos);
if (startPos == std::string::npos)
{
break;
}
cosImgUrl += ";";
}
trace_printf("cosImgUrl.c_str() %s", cosImgUrl.c_str());
return cosImgUrl;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。