开发学院手机开发Symbian 开发 Symbian 读写 INI 配置文件的方法 阅读

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_p

{

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; iCount(); 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; iCount(); i++)

{

//IniElement *tmp = m_pIniElements->At(i);

if( (m_pIniElements->At(i)->_Section.Compare( (TDesC8&)p_Section

上一页  3 4 5 6 7 8 9 10  下一页

Tags:Symbian 读写 INI

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接