Introduction
hi, This description is Ini file control, Sharing code with others is a great way to not only help others, but also to become a better programmer. With many thousands of people downloading your code you will not only get a lot of positive feedback, but also bug fixes, free testing, and more often than not, suggestions on how to make the code even better. It also encourages others to share their code, which in turn gives you access to an even larger base of free source code.
So Sorry !!
[Modified: -explain]
I made CXIniFiles class, this class control(, Key and section , key value, add, delete, modify) INI-file. and inform(total number of section, number of key etc) ini-file.
CXIniFiles Class like this:
class CXIniFiles
{
private:
BOOL IsDataChanged; // Handle of Current IniFile
CString IniPath; // Ini File full path
struct XSection //Struct of Inifile
{
CString SectionName;
CArray<CString ,CString > Keys;
CArray<CString ,CString > Values;
};
CArray<XSection,XSection> Sections;
CString LegalString(CString path);
int AddSection(CString sectionname);
int AddSection(CStringArray mKeys,CStringArray mValues,CString sectionname);
void SetPath(CString path);
public:
//Construction & destruction
CXIniFiles();
virtual ~CXIniFiles();
BOOL Open(CString path);
void Reset();
void Close();
void DoNotWrite();
BOOL Write();
int GetSectionIndex(CString sectionname);
int GetSection(CStringArray &mKeys,CStringArray &mValues,CString sectionname);
int GetSetionsSize(){return Sections.GetSize();}
int GetKeyIndex(int sectionIndex,CString keyname);
int GetKeysSize(CString sectionname);
CString GetSection(int sectionIndex);
CString GetKeyName(int sectionIndex, int keyIndex);
CString GetKeyValue(CString sctionname,CString keyname);
int DeleteSection(CString strsectionname);
int AddKey(CString sectionname,CString keyname,CString value);
int DeleteKey(CString sectionname,CString delkey);
BOOL IsSection(CString sectionname);
BOOL IsKey(CString sectionname , CString keyname);
int SetKeyValue(CString sectionname,CString keyname,CString value);
int SetSectionValue(CString oldname,CString newname);
};
Very Simple Constructure!!!
Set and Get , and Is , ADD, DELETE real control method
Have a Nice Day and a Beautiful Life!!!
Do U Have a any Question, Send Mail plz.