Symbian 读写 INI 配置文件的方法
2010-04-20 16:06:00 来源:WEB开发网{
IniElement *element = new(ELeave) IniElement;
element->_Section.Copy(_L8(“###”));
element->_Key.Copy(_L8(“##”));
element->_Value.Copy(pTmp->Des());
m_pIniElements->AppendL(element);
} else //section?е?ע?Ϳ???
{
IniElement *element = new(ELeave) IniElement;
element->_Section.Copy(szCurSection);
element->_Key.Copy(_L8(“##”));
element->_Value.Copy(pTmp->Des());
m_pIniElements->AppendL(element);
}
}
delete pTmp;
iCursor.Set( iCursor.Right(iCursor.Length() ? (iPos +2)) );//
}
delete bufc;
CloseIni(); //?ر??ļ????
return 1;
}
TInt CIniFile::GetValue(const TDesC8 &p_Section, const TDesC8 &p_Key, TDes8 &p_Value )
{
for(int i=0; i
{
if( (m_pIniElements->At(i)->_Section.Compare( (TDesC8&)p_Section ) ==0 ) &&
(m_pIniElements->At(i)->_Key.Compare( (TDesC8&)p_Key ) ==0 ) )
{
p_Value.Copy(m_pIniElements->At(i)->_Value);
return 1;
}
}
return 0;
}
TInt CIniFile::PutValue(const TDesC8 &p_Section, const TDesC8 &p_Key, const TDesC8 &p_Value )
{
IniElement *element = new(ELeave) IniElement;
element->_Section.Copy(p_Section);
element->_Key.Copy(p_Key);
element->_Value.Copy(p_Value);
TInt b_KeyFind = 0;
for(int i = 0; i
{
//IniElement *tmp = m_pIniElements->At(i);
if( (m_pIniElements->At(i)->_Section.Compare( (TDesC8&)p_Section
赞助商链接