锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品99久久久久久宅男
,伊人久久久AV老熟妇色,久久久久久国产a免费观看黄色大片http://www.shnenglu.com/iwangchuchu/archive/2010/04/08/110323.html#111944jmchxyjmchxyThu, 08 Apr 2010 04:17:00 GMThttp://www.shnenglu.com/iwangchuchu/archive/2010/04/08/110323.html#111944bool JFileConfig::getValue(LPCTSTR sectionName, LPCTSTR name, JConfigVal& rval)const
{
// 鏌ユ壘鑺?br> JString jstrSection(sectionName);
JString jstrName(name);
bool bRet = false;
// 鏌ョ湅鏄惁宸茬粡瀛樺湪
ConstSectionIter iter = findSection( jstrSection );
// 瀛樺湪鑺?br> if(iter == m_Sections.end())
{
return false;
}
return iter->get(jstrName, rval);
}
/////////////////////////////////////////////
// 瑁呰澆閰嶇疆淇℃伅, 浠庢枃浠舵垨鍏朵粬濯掍粙
/////////////////////////////////////////////
#ifdef _DEBUG
#define _OUTPUT_STATE
#endif
bool JFileConfig::load(LPCTSTR pszFilename)
{
JStdioFile inifile(pszFilename, JFileBase::modeRead);
JString CurSection;
while(!inifile.eof())
{
//閫愯鍒嗘瀽鏁版嵁
JString line = inifile.getline();
// 鍘繪帀鏈熬鐨勮璁℃暟絎?br> line.chomp();
if(line.length() == 0)
{
continue; //璺寵繃絀鴻
}
// 濡傛灉鏄敞閲婅, 璺寵繃
// ; 鍜?# 寮濮嬬殑琛屾槸娉ㄩ噴
if( (line[0] == _T(';'))||(line[0] == _T('#')))
{
continue;
}
if(line[0] == _T('['))
{
//鏄妭鍚?
int i = line.find( _T(']') );
if(i > 0)
{// 鑺傚悕, 鍙栧嚭鑺傜殑鍚嶅瓧, 鍒涘緩鑺?br> CurSection = line.substr(1, i-1);
createSection(CurSection);
#ifdef _OUTPUT_STATE //璋冭瘯鐢?br> _tprintf( _T("create seciton: %s\n"), CurSection.c_str());
#endif
}
continue; //閿欒鐨勮鐩存帴璺寵繃
}
else
{ // 鍚?鍊?瀵瑰畾涔夌殑琛? 鏌ユ壘 '=' 瀛楃
int i = line.find( _T('='));
if(i <= 0)
{
continue; //娌℃湁 = 瀛楃, 璺寵繃
}
JString strName = line.substr(0, i);
strName.TrimRight();
JString strValue = line.substr(i + 1, -1);
strValue.TrimLeft();
// 鎻掑叆鍊?br> setString(CurSection, strName, strValue);
}
}
return true;
}
//-------------------------------------
// 淇濆瓨閰嶇疆鍒版枃浠?br>//-------------------------------------
bool JFileConfig::save(LPCTSTR pszFilename)const
{
JFile inifile(pszFilename, JFileBase::modeWrite|JFileBase::modeCreate);
JString strLine(128);
for(ConstSectionIter sectIter = m_Sections.begin();
sectIter != m_Sections.end();
++sectIter)
{
// 褰撳墠鑺傜殑鍚嶅瓧
const JString& sectionNmae = sectIter->m_strSectionName;
// 鍐欏叆鑺傚悕
strLine.clear();
strLine += _T("[");
strLine += sectionNmae;
strLine += _T("]\r\n");
inifile.write(strLine.c_str(), strLine.length());
// 褰撳墠鑺傚搴旂殑map
const Dict& CurSection = sectIter->m_Items;
// 閬嶅巻鍚嶅瓧/鍊?br> ConstDictIterator dictIter = CurSection.begin();
while(dictIter != CurSection.end())
{
const JString& name = dictIter->first;
const JConfigVal& value = dictIter->second;
strLine.clear();
strLine += name;
strLine += _T("=");
strLine += value.toString();
strLine += _T("\r\n");
inifile.write(strLine.c_str(), strLine.length());
++dictIter;
}
}
return true;
}
鍥炲涓嶈兘澶暱錛?榪欐槸鎴戠殑搴撲腑瀹氫箟鐨?inifile 澶勭悊綾?img src ="http://www.shnenglu.com/iwangchuchu/aggbug/111944.html" width = "1" height = "1" />
]]>- re: STL瀹瑰櫒瀹炵幇IniFileParserhttp://www.shnenglu.com/iwangchuchu/archive/2010/04/08/110323.html#111940jmchxyjmchxyThu, 08 Apr 2010 04:12:00 GMThttp://www.shnenglu.com/iwangchuchu/archive/2010/04/08/110323.html#111940#define __JFILECONFIG_H__
/////////////////////////////////////////////
/// JFileConfig ini鏂囦歡鎿嶄綔綾?br>/////////////////////////////////////////////
#include "jconfig.h"
#include <map>
#include <vector>
namespace jlib
{
// ini 鏂囦歡涓悕瀛椾笉鍒嗗ぇ灝忓啓
struct SectionLess
{
bool operator() (const JString& Key1, const JString& Key2)const
{
return Key1.compareNoCase(Key2) < 0;
}
};
//-------------------------------------------
// 瀹氫箟foreach 鍑芥暟闇瑕佷嬌鐢ㄧ殑鍑芥暟綾誨瀷
// pArg 涓轟紶閫掔粰 鍑芥暟鐨勬暟鎹?br>//-------------------------------------------
typedef bool (*FOREACHFUNC)(const JString& section, const JString& name, JConfigVal& value, LPVOID pArg);
class JLIBAPI JFileConfig: JConfigBase
{
public:
// 鏋勯犳瀽鏋勫嚱鏁?br> JFileConfig();
virtual ~JFileConfig();
public:
// 瑁呰澆閰嶇疆淇℃伅, 浠庢枃浠舵垨鍏朵粬濯掍粙
virtual bool load(LPCTSTR pszFilename);
// 淇濆瓨閰嶇疆鍒版枃浠?br> virtual bool save(LPCTSTR pszFilename)const;
// 鑾峰彇閰嶇疆淇℃伅, key, name, 鑾峰緱value
// 璇誨彇澶辮觸榪斿洖 false
// 鑾峰彇閫氱敤綾誨瀷鐨勫?br> virtual bool getValue(LPCTSTR sectionName, LPCTSTR name, JConfigVal& jRval)const;
// 鑾峰彇鏁存暟鍊?br> virtual bool getInt(LPCTSTR sectionName, LPCTSTR name, int& iRval)const;
// 鑾峰彇瀛楃涓?br> virtual bool getString(LPCTSTR sectionName, LPCTSTR name, JString& szRval)const;
// 璁劇疆閰嶇疆, 濡傛灉娌℃湁鍒欏垱寤烘寚瀹氬悕/鍊?br> // 璁劇疆閫氱敤綾誨瀷鐨勫?br> virtual bool setValue(LPCTSTR sectionName, LPCTSTR name, const JConfigVal& jVal);
// 璁劇疆鏁村瀷鐨勫?br> virtual bool setInt(LPCTSTR sectionName, LPCTSTR name, int iVal);
// 璁劇疆瀛楃涓插? 濡傛灉娌℃湁鍒欏垱寤烘寚瀹氬悕/鍊?br> virtual bool setString(LPCTSTR sectionName, LPCTSTR name, LPCTSTR szVal);
//--------------------------------------------------
// 閬嶅巻鍑芥暟
// 濡傛灉鐢ㄦ埛瀹氫箟鐨勯亶鍘嗗嚱鏁拌繑鍥炰簡 false, 緇撴潫閬嶅巻
bool foreach(FOREACHFUNC fpForeach, LPVOID pArgs);
//========================================
#ifdef _UNIT_TEST_ //鍗曞厓嫻嬭瘯, 閬嶅巻涓涓猧ni鏂囦歡
static void unitTest(LPCTSTR filename);
#endif //_UNIT_TEST_
//========================================
public:
/////////////////////////////////////////////
/// 閰嶇疆鑺備俊鎭?br> /////////////////////////////////////////////
typedef std::map<JString, JConfigVal, SectionLess> Dict;
typedef std::map<JString, JConfigVal, SectionLess>::iterator DictIterator;
typedef std::map<JString, JConfigVal, SectionLess>::const_iterator ConstDictIterator;
// 緇撶偣淇℃伅
struct JConfigSection
{
JString m_strSectionName; //鑺傚悕
Dict m_Items; //鍚?鍊煎皪
public:
JConfigSection(): m_strSectionName(), m_Items() { }
~JConfigSection(){ m_Items.clear(); }
// 鍔犲叆涓涓?鍚?鍊?瀵?br> bool set(const JString& name, const JConfigVal& value)
{
// 鏌ユ壘鍐呭
DictIterator iter = m_Items.find( name );
if(iter == m_Items.end())
{
// 娌℃壘鍒? 鎻掑叆
m_Items.insert( Dict::value_type( name, value));
}
// 濡傛灉宸插瓨鍦? 淇敼
m_Items[name] = value;
return true;
}
bool get(JString& name, JConfigVal& value)const
{
// 鏌ユ壘鍐呭
ConstDictIterator iter = m_Items.find( name );
if(iter == m_Items.end())
{
// 娌℃壘鍒?
return false;
}
// 濡傛灉宸插瓨鍦? 榪斿洖
value = iter->second;
return true;
}
};
private:
//
typedef std::vector<JConfigSection>::iterator SectionIter;
typedef std::vector<JConfigSection>::const_iterator ConstSectionIter;
// 鍒涘緩涓涓妭
bool createSection(const JString& sectionName);
// 鏌ユ壘鑺? 榪斿洖瀵瑰簲鐨勭儲寮?br> // 濡傛灉涓嶅瓨鍦? 榪斿洖 end(),
ConstSectionIter findSection(const JString& sectionName)const;
SectionIter findSection(const JString& sectionName);
// const static int MAX_SECTION = 10; //鏈澶氱殑鑺傛暟
private:
std::vector<JConfigSection> m_Sections;
// 涓嶅厑璁告嫹璐濆璞?br> DECLARE_NO_COPY_CLASS(JFileConfig);
};
} //end namespace
#endif //__JFILECONFIG_H__
]]> - re: STL瀹瑰櫒瀹炵幇IniFileParserhttp://www.shnenglu.com/iwangchuchu/archive/2010/03/29/110323.html#110882娣℃湀娓呴娣℃湀娓呴Mon, 29 Mar 2010 08:29:00 GMThttp://www.shnenglu.com/iwangchuchu/archive/2010/03/29/110323.html#110882
]]> - re: STL瀹瑰櫒瀹炵幇IniFileParserhttp://www.shnenglu.com/iwangchuchu/archive/2010/03/23/110323.html#110369钀岃悓钀岃悓Tue, 23 Mar 2010 12:03:00 GMThttp://www.shnenglu.com/iwangchuchu/archive/2010/03/23/110323.html#110369
]]> - re: STL瀹瑰櫒瀹炵幇IniFileParserhttp://www.shnenglu.com/iwangchuchu/archive/2010/03/23/110323.html#110338闄堟鐎?vczh)闄堟鐎?vczh)Tue, 23 Mar 2010 03:23:00 GMThttp://www.shnenglu.com/iwangchuchu/archive/2010/03/23/110323.html#110338http://www.shnenglu.com/vczh/archive/2010/03/07/109103.html

]]>
久久亚洲美女精品国产精品|
噜噜噜色噜噜噜久久|
久久国产精品-久久精品|
久久精品国产亚洲麻豆|
亚洲国产成人精品久久久国产成人一区二区三区综
|
精品久久久无码21p发布
|
97超级碰碰碰碰久久久久|
久久国产精品免费一区|
狠狠色婷婷久久一区二区
|
超级97碰碰碰碰久久久久最新|
麻豆成人久久精品二区三区免费
|
色综合久久无码中文字幕|
99精品伊人久久久大香线蕉|
国产成人久久精品一区二区三区|
国产精品禁18久久久夂久|
中文字幕无码久久久|
伊人久久大香线蕉精品|
亚洲av日韩精品久久久久久a|
久久久久久久久久免免费精品|
久久亚洲精品无码AV红樱桃|
久久精品国产99国产精品|
国产精品久久久久久|
久久综合噜噜激激的五月天|
一本色综合久久|
欧美国产精品久久高清|
热99re久久国超精品首页|
无码人妻久久一区二区三区免费
|
国内精品久久久久影院薰衣草
|
99久久成人国产精品免费|
一本久久a久久精品vr综合|
亚洲国产精品一区二区三区久久|
久久精品中文字幕久久|
国产亚洲欧美成人久久片|
国产91久久精品一区二区|
999久久久无码国产精品|
a级成人毛片久久|
AAA级久久久精品无码片|
久久国产精品-久久精品|
亚洲午夜久久影院|
久久久噜噜噜久久中文字幕色伊伊|
久久精品二区|