摘要: 在牛人的指导下,和前一个版本有了较大改变。逐行读取配置文件,然后逐行解析~读取一次之后,将键值对存入map,之后都从map中去取,减少读取文件次数主要代码如下:/*** * read config file, add into map.* @param filepath (in)line text* @param return * -1:error,invalid line* 0:success* */int INIReader::readFile(const wstring &filename) { std::string strFi... 阅读全文
posted @ 2013-07-11 14:14 yejg1212 阅读(3694) 评论(0) 推荐(0) 编辑
摘要: 自从大学学完C之后,就再也没用过它了,在网上找代码,七拼八凑之后,终于成形~~勉强能用,不喜勿喷,^_^!int GetValue(const wchar_t *key, wchar_t *value){ FILE* fpcfg = NULL; wchar_t var[256], val[256];//key,value wchar_t linebuf[1024]; wchar_t* ptr1 = NULL; wchar_t* ptr2 = NULL; wchar_t* delimiter = NULL; int k = 0; assert(ke... 阅读全文
posted @ 2013-07-11 13:57 yejg1212 阅读(1613) 评论(0) 推荐(0) 编辑