1 Star 0 Fork 0

unitwork/iwechen-thrift

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ImgUrl.cpp 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
#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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/unitwork/iwechen-thrift.git
git@gitee.com:unitwork/iwechen-thrift.git
unitwork
iwechen-thrift
iwechen-thrift
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385