﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Midapex Village-最新评论</title><link>http://www.cppblog.com/dyj057/CommentsRSS.aspx</link><description>十里平湖霜满天，寸寸青丝愁华年。
对月形单望相护，只羡鸳鸯不羡仙。</description><language>zh-cn</language><pubDate>Sat, 15 Dec 2007 03:11:00 GMT</pubDate><lastBuildDate>Sat, 15 Dec 2007 03:11:00 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 发布跨平台INI文件读写API(C++版本) V0.2.1</title><link>http://www.cppblog.com/dyj057/archive/2008/05/09/38074.html#49295</link><dc:creator>wuxunfeng</dc:creator><author>wuxunfeng</author><pubDate>Fri, 09 May 2008 05:05:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/05/09/38074.html#49295</guid><description><![CDATA[谢谢楼主的共享。 <br>有个问题想问一下。如果 INI文件中，同一个SECTION中，有几个同样的KEY，那么读取的时候，会读取哪个KEY呢，可以循环读取吗.例： <br>[SECTION] <br>key=data <br>key=data <br>key=data <br>key1=data2<img src ="http://www.cppblog.com/dyj057/aggbug/49295.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">wuxunfeng</a> 2008-05-09 13:05 <a href="http://www.cppblog.com/dyj057/archive/2008/05/09/38074.html#49295#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>函数库有这个功能吗？</title><link>http://www.cppblog.com/dyj057/archive/2008/05/09/3012.html#49294</link><dc:creator>wuxunfeng</dc:creator><author>wuxunfeng</author><pubDate>Fri, 09 May 2008 05:03:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/05/09/3012.html#49294</guid><description><![CDATA[  谢谢楼主的共享。<br>  有个问题想问一下。如果 INI文件中，同一个SECTION中，有几个同样的KEY，那么读取的时候，会读取哪个KEY呢，可以循环读取吗.例：<br>[SECTION]<br>key=data<br>key=data<br>key=data<br>key1=data2<img src ="http://www.cppblog.com/dyj057/aggbug/49294.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">wuxunfeng</a> 2008-05-09 13:03 <a href="http://www.cppblog.com/dyj057/archive/2008/05/09/3012.html#49294#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 发布跨平台INI文件读写API(C++版本) V0.2.1</title><link>http://www.cppblog.com/dyj057/archive/2008/04/26/38074.html#48189</link><dc:creator>luoweiliuz</dc:creator><author>luoweiliuz</author><pubDate>Sat, 26 Apr 2008 08:09:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/04/26/38074.html#48189</guid><description><![CDATA[测试时发现问题，例如我在循环写<br>[name]<br>Row1=J ???????被大10 的替换<br>Row2=B<br>Row3=C<br>Row4=D<br>Row5=E<br>Row6=F<br>Row7=G<br>Row8=H<br>Row9=I<br>Row10=J ???????这个地方开始以后没有输出，但是覆盖了 Row1 的值<br>Row11=K<br><img src ="http://www.cppblog.com/dyj057/aggbug/48189.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">luoweiliuz</a> 2008-04-26 16:09 <a href="http://www.cppblog.com/dyj057/archive/2008/04/26/38074.html#48189#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: C++完美实现Singleton模式</title><link>http://www.cppblog.com/dyj057/archive/2008/03/25/346.html#45384</link><dc:creator>kendan</dc:creator><author>kendan</author><pubDate>Tue, 25 Mar 2008 12:33:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/03/25/346.html#45384</guid><description><![CDATA[学习了。。。。。<img src ="http://www.cppblog.com/dyj057/aggbug/45384.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">kendan</a> 2008-03-25 20:33 <a href="http://www.cppblog.com/dyj057/archive/2008/03/25/346.html#45384#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 发布跨平台INI文件读写API(C++版本) V0.2.1</title><link>http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45348</link><dc:creator>豆花鱼片</dc:creator><author>豆花鱼片</author><pubDate>Tue, 25 Mar 2008 07:03:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45348</guid><description><![CDATA[上面的代码有误, 应该这个:<br><br><br>int IniFile::parse_file(const char *section, const char *key, const char *buf,int *sec_s,int *sec_e,<br>					  int *key_s,int *key_e, int *value_s, int *value_e)<br>{<br>	const char *p = buf;<br>	int i=0;<br><br>	assert(buf!=NULL);<br>	assert(section != NULL &amp;&amp; strlen(section));<br>	assert(key != NULL &amp;&amp; strlen(key));<br><br>	*sec_e = *sec_s = *key_e = *key_s = *value_s = *value_e = -1;<br><br>	while( !end_of_string(p[i]) ) {<br>		//find the section<br>		if( ( 0==i ||  newline(p[i-1]) ) &amp;&amp; left_barce(p[i]) )<br>		{<br>			int section_start=i+1;<br><br>			//find the ']'<br>			do {<br>				i++;<br>			} while( !right_brace(p[i]) &amp;&amp; !end_of_string(p[i]));<br><br>			if( 0 == strncmp(p+section_start,section, i-section_start)) {<br>				int newline_start=0;<br><br>				i++;<br><br>				//Skip over space char after ']'<br>				while(isspace(p[i])) {<br>					i++;<br>				}<br><br>				//find the section<br>				*sec_s = section_start;<br>				*sec_e = i;<br><br>				while( ! (newline(p[i-1]) &amp;&amp; left_barce(p[i])) <br>					&amp;&amp; !end_of_string(p[i]) ) {<br>						int j=0;<br>						//get a new line<br>						newline_start = i;<br><br>						while( !newline(p[i]) &amp;&amp;  !end_of_string(p[i]) ) {<br>							i++;<br>						}<br><br>						//now i  is equal to end of the line<br>						j = newline_start;<br>						int valid = j;<br><br>						if('#' != p[j]) //skip over comment<br>						{ <br>							while(j &lt; i &amp;&amp; p[j]!='=') {<br>								j++;<br><br>								if(' ' != p[j] &amp;&amp;  '\t' != p[j] &amp;&amp; '=' != p[j])<br>								  valid = j;<br>								if('=' == p[j]) {<br>									if(strncmp(key,p+newline_start,valid-newline_start)==0)<br>									{<br>										//find the key ok<br>										*key_s = newline_start;<br>										*key_e = j-1;<br><br>                    valid = j+1;<br>                    while(' ' == p[valid] || '\t' == p[valid])<br>                      valid++;<br>										*value_s = valid;<br>										*value_e = i;<br><br>										return 1;<br>									}<br>								}<br>							}<br>						}<br><br>						i++;<br>				}<br>			}<br>		}<br>		else<br>		{<br>			i++;<br>		}<br>	}<br>	return 0;<br>}<br><br><img src ="http://www.cppblog.com/dyj057/aggbug/45348.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">豆花鱼片</a> 2008-03-25 15:03 <a href="http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45348#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 发布跨平台INI文件读写API(C++版本) V0.2.1</title><link>http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45345</link><dc:creator>豆花鱼片</dc:creator><author>豆花鱼片</author><pubDate>Tue, 25 Mar 2008 06:02:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45345</guid><description><![CDATA[挺不错的, 我在你的代码上修改了IniFile::parse_file方法,<br>使其能分析<br>name =   value<br>这种=两边带有空格或\t的格式:<br><br><br><br>int IniFile::parse_file(const char *section, const char *key, const char *buf,int *sec_s,int *sec_e,<br>					  int *key_s,int *key_e, int *value_s, int *value_e)<br>{<br>	const char *p = buf;<br>	int i=0;<br><br>	assert(buf!=NULL);<br>	assert(section != NULL &amp;&amp; strlen(section));<br>	assert(key != NULL &amp;&amp; strlen(key));<br><br>	*sec_e = *sec_s = *key_e = *key_s = *value_s = *value_e = -1;<br><br>	while( !end_of_string(p[i]) ) {<br>		//find the section<br>		if( ( 0==i ||  newline(p[i-1]) ) &amp;&amp; left_barce(p[i]) )<br>		{<br>			int section_start=i+1;<br><br>			//find the ']'<br>			do {<br>				i++;<br>			} while( !right_brace(p[i]) &amp;&amp; !end_of_string(p[i]));<br><br>			if( 0 == strncmp(p+section_start,section, i-section_start)) {<br>				int newline_start=0;<br><br>				i++;<br><br>				//Skip over space char after ']'<br>				while(isspace(p[i])) {<br>					i++;<br>				}<br><br>				//find the section<br>				*sec_s = section_start;<br>				*sec_e = i;<br><br>				while( ! (newline(p[i-1]) &amp;&amp; left_barce(p[i])) <br>					&amp;&amp; !end_of_string(p[i]) ) {<br>						int j=0;<br>						//get a new line<br>						newline_start = i;<br><br>						while( !newline(p[i]) &amp;&amp;  !end_of_string(p[i]) ) {<br>							i++;<br>						}<br><br>						//now i  is equal to end of the line<br>						j = newline_start;<br>						int valid = j;<br><br>						if('#' != p[j]) //skip over comment<br>						{<br>							while(j &lt; i &amp;&amp; p[j]!='=') {<br>								j++;<br>								if('=' == p[j]) {<br>									if(strncmp(key,p+newline_start,valid-newline_start)==0)<br>									{<br>										//find the key ok<br>										*key_s = newline_start;<br>										*key_e = j-1;<br><br>                    while(' ' == p[valid] || '\t' == p[valid])<br>                      valid++;<br>										*value_s = valid;<br>										*value_e = i;<br><br>										return 1;<br>									}<br>								}<br>								if(' ' != p[j] &amp;&amp;  '\t' != p[j])<br>								  valid = j;<br>							}<br>						}<br><br>						i++;<br>				}<br>			}<br>		}<br>		else<br>		{<br>			i++;<br>		}<br>	}<br>	return 0;<br>}<img src ="http://www.cppblog.com/dyj057/aggbug/45345.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">豆花鱼片</a> 2008-03-25 14:02 <a href="http://www.cppblog.com/dyj057/archive/2008/03/25/38074.html#45345#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 迷你型XML文档生成器(ANSI C)</title><link>http://www.cppblog.com/dyj057/archive/2008/03/25/18132.html#45326</link><dc:creator>suxiaojack</dc:creator><author>suxiaojack</author><pubDate>Mon, 24 Mar 2008 23:15:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/03/25/18132.html#45326</guid><description><![CDATA[不错，要是把函数指针封装在文档类型中感觉更好用。<img src ="http://www.cppblog.com/dyj057/aggbug/45326.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">suxiaojack</a> 2008-03-25 07:15 <a href="http://www.cppblog.com/dyj057/archive/2008/03/25/18132.html#45326#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: ubuntu 7.10真酷，我好喜欢(效果图已经更新)</title><link>http://www.cppblog.com/dyj057/archive/2008/03/06/34758.html#43835</link><dc:creator>-_-</dc:creator><author>-_-</author><pubDate>Thu, 06 Mar 2008 09:35:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/03/06/34758.html#43835</guid><description><![CDATA[可否提供你使用的Ubuntu的字体设置,桌面皮肤之类?我的字体和皮肤没搞好<img src ="http://www.cppblog.com/dyj057/aggbug/43835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">-_-</a> 2008-03-06 17:35 <a href="http://www.cppblog.com/dyj057/archive/2008/03/06/34758.html#43835#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 发布跨平台INI文件读写API(C版本) V0.2.0</title><link>http://www.cppblog.com/dyj057/archive/2008/01/23/37958.html#41701</link><dc:creator>yen</dc:creator><author>yen</author><pubDate>Wed, 23 Jan 2008 03:17:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2008/01/23/37958.html#41701</guid><description><![CDATA[十分感谢!我正需要这样一个工具.您帮我大忙<img src ="http://www.cppblog.com/dyj057/aggbug/41701.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">yen</a> 2008-01-23 11:17 <a href="http://www.cppblog.com/dyj057/archive/2008/01/23/37958.html#41701#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 我的计算机情缘</title><link>http://www.cppblog.com/dyj057/archive/2007/12/27/27349.html#39758</link><dc:creator>Midapex</dc:creator><author>Midapex</author><pubDate>Thu, 27 Dec 2007 12:19:00 GMT</pubDate><guid>http://www.cppblog.com/dyj057/archive/2007/12/27/27349.html#39758</guid><description><![CDATA[没问题，等我有空了，写一个专题介绍CGI+XML+jQuery+extjs实现Ajax的文章。<img src ="http://www.cppblog.com/dyj057/aggbug/39758.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/dyj057/" target="_blank">Midapex</a> 2007-12-27 20:19 <a href="http://www.cppblog.com/dyj057/archive/2007/12/27/27349.html#39758#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>