Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1085496
  • 博文数量: 80
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 746
  • 用 户 组: 普通用户
  • 注册时间: 2018-06-12 20:01
个人简介

寫写code、调調bug、填填坑,僅此而已。

文章分类

全部博文(80)

文章存档

2019年(30)

2018年(50)

分类: C/C++

2019-04-11 13:32:43


点击(此处)折叠或打开

  1. void readNvidiaConf(map<string,string> &m_config)
  2. {
  3.     ifstream cfg_file;
  4.     string path="./test.conf";
  5.     cfg_file.open(path.c_str());
  6.     string str_line;
  7.     if(cfg_file.is_open())
  8.     {
  9.         while(!cfg_file.eof())
  10.         {
  11.           getline(cfg_file,str_line);
  12.           if(str_line.find("#")==0)
  13.             continue;
  14.           size_t pos=str_line.find('=');
  15.           string key=str_line.substr(0,pos);
  16.           string value=str_line.substr(pos+1);
  17.           m_config.insert(pair<string,string>(key,value));
  18.         }
  19.     }
  20.     cfg_file.close();
  21. }

阅读(4029) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~