当前位置:网站首页>Analysis of tars source code 26
Analysis of tars source code 26
2022-07-21 17:15:00 【Tao song remains the same】
decode Related actions , This simple :
#include "util/tc_option.h"
#include "util/tc_common.h"
namespace tars
{
void TC_Option::decode(int argc, char *argv[])
{
_mParam.clear();
vector<string> v;
for(int i = 1; i < argc; i++)
{
v.push_back(argv[i]);
}
for(size_t i = 0; i < v.size(); i++)
{
if(v[i].length() > 2 && v[i].substr(0,2) == "--")
{
parse(v[i]);
}
else
{
_vSingle.push_back(v[i]);
}
}
}
void TC_Option::parse(const string &s)
{
string::size_type pos = s.find('=');
if( pos != string::npos)
{
_mParam[s.substr(2, pos-2)] = s.substr(pos+1);
}
else
{
_mParam[s.substr(2, pos-2)] = "";
}
}
string TC_Option::getValue(const string &sName)
{
if(_mParam.find(sName) != _mParam.end())
{
return _mParam[sName];
}
return "";
}
bool TC_Option::hasParam(const string &sName)
{
return _mParam.find(sName) != _mParam.end();
}
vector<string>& TC_Option::getSingle()
{
return _vSingle;
}
map<string, string>& TC_Option::getMulti()
{
return _mParam;
}
}
边栏推荐
- vscode setting.json
- 1190. 反转每对括号间的子串
- 看起来是线程池的BUG,但是我认为是源码设计不合理。
- Explanation of redis memory model
- Splunk HEC 开启8088 port
- Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?
- shell脚本按日期范围和间隔下载数据
- 什么是视频内容推荐引擎?
- 我用Redis分布式锁,抢了瓶茅台,然后GG了~~
- [interview: concurrent Article 19: multithreading: Park & unpark]
猜你喜欢
联邦学习: 联邦场景下的时空数据挖掘
进程的组织方式:链接方式和索引方式
The remote control software should also have plan B alternatives
mysql数据库查询好慢,除了索引,还能因为什么?
Four redis cluster schemes and their advantages and disadvantages
What is a video content recommendation engine?
It seems to be a bug of thread pool, but I think the source code design is unreasonable.
Kube controller manager principle
Monitor Deep Learning Training Progress
4种 Redis 集群方案及优缺点对比
随机推荐
Games101 graphics p12 notes (geometry3)
第04篇:Guava-retry重试组件
如何将 @Transactional 事务注解运用到炉火纯青?
CDH集群 不良 : 群集中有 1,855 个 副本不足的块 块。群集中共有 1,857 个块。百分比 副本不足的块: 99.89%。 临界阈值:40.00%。
1190. 反转每对括号间的子串
740. Delete and get points
redis集群安装
1011. 在 D 天内送达包裹的能力
1011. Ability to deliver packages within D days
有没有完全自主的国产化数据库技术
tars源码分析之23
遍历文件夹以及子文件夹的图片,利用opencv改变大小并保存直一个文件夹
进程的阻塞和唤醒
JUC并发编程 wait notify详解
kubernetes部署mysql5.7(单节点)
第03篇:SQL语法树解析
The top three suddenly changed, revealing the latest ranking of programming languages in July
The remote control software should also have plan B alternatives
让实习生搭个Redis集群,差点把我”搭“进去~~~
I used redis distributed lock, grabbed bottle Maotai, and then GG~~