解析命令行一例
来源:互联网 发布:正定矩阵因子分解模型 编辑:程序博客网 时间:2024/05/21 22:48
//str_Content为命令行,para为解析后存储位置
BOOL ParseParam(const CString &str_Content,map<CString,CString>¶)
{
BOOL bres = TRUE;
int nIndexB,nIndexE;
CString str_Param = str_Content;
CString str_temp,str_key,str_value;
do
{
nIndexB = str_Param.Find(",");
if ( -1 == nIndexB )
{
IndexB = str_Param.Find(";");
if ( -1 == nIndexB )
{ break; }
}
str_temp = str_Param.Left(nIndexB);
str_Param = str_Param.Right(str_Param.GetLength() - nIndexB -1);
str_temp.TrimLeft();
str_temp.TrimRight();
str_Param.TrimLeft();
str_Param.TrimRight();
nIndexE = str_temp.Find("=");
if ( -1 == nIndexE )
{ continue; }
else
{
str_key = str_temp.Left(nIndexE);
str_value = str_temp.Right(str_temp.GetLength() - nIndexE - 1);
str_key.TrimLeft();
str_key.TrimRight();
str_value.TrimLeft();
str_value.TrimRight(); //得到命令名与值,存储到自己的结构中
//................................
para.insert(make_pair(str_key,str_value));
}
}
while (1);
return bres;
}
- 解析命令行一例
- linux命令行解析(一)
- Python 命令行解析工具 Argparse介绍(一)
- 用Google的gflags优雅的解析命令行参数(一)
- Python 命令行解析工具 Argparse介绍(一)
- Python 命令行解析工具 Argparse介绍(一)
- Python 命令行解析工具 Argparse介绍(一)
- Search and Replace 命令行应用一例
- 命令行参数解析(1)
- 命令行参数解析(2)
- 命令行参数解析实例
- linux解析命令行
- 解析命令行参数
- 命令行参数的解析
- ruby命令行解析
- Linux 命令行参数解析
- VC命令行参数解析
- 解析命令行参数
- 1275 Cashier Employment 差分约束系统+BELLMAN
- 七年IT经验的七个总结
- 误删除linux导致双系统无法进入windows
- Linux内核内存分配
- HibernateDaoSupport 类session未关闭导致的连接泄露问题
- 解析命令行一例
- printf/scanf格式控制符的完整格式
- VC 中的精确延时
- 面向对象编程的理解与分析
- 小写RMB转大写RMB
- C++基础之拷贝构造函数
- asp.net页面的生命周期
- jQuery1.4源码学习六
- Unhandled exception in XXX.exe(MFCO42D.dll)0xC00000005:Access Violation