델파이의 TIniFiles.ReadNames 와 유사한 작업을 하는 방법에 대한 것입니다.
wxConfigBase::GetFirstGroup();
wxConfigBase::GetFirstEntry();
wxConfigBase::GetNextGroup();
wxConfigBase::GetNextEntry();
wxConfigBase::GetNumberOfEntries();
wxConfigBase::GetNumberOfGroups();
wxConfigBase::HasEntry();
wxConfigBase::HasGroup();
위에 열거한 함수들을 활용하여 INI Key 이름을 몰라도 동적으로 정보를 읽어 처리할 수 있습니다.
다음은 간단한 예제입니다.
// enumeration variables wxString key; long dummy; // Go to the section config.SetPath(_T("Files")); bool bCont = config.GetFirstEntry(key, dummy); while ( bCont ) { // At this point key contains the entry name (key) // You can use it to get entry value wxString value = config.Read(key, ""); // Do something with the pair (key, value) ... // Get next entry bCont = config.GetNextEntry(key, dummy); }
참고자료
How to use wxFileConfig with unknown key names
728x90
반응형
'프로그래밍 > C,C++' 카테고리의 다른 글
[Mingw] How to build wxFreeChart with wxWidgets(2.9.4) (0) | 2013.07.15 |
---|---|
[Mingw] How to build wxWidgets. (0) | 2013.07.12 |
[wxWidgets] wxTreeCtrl에서 File Drag & Drop 처리 (0) | 2012.06.08 |
[CLI] Windows Form 소스인데, 폼 디자이너가 보이지 않는 문제 (0) | 2011.12.14 |
[Paramics] 사용자 정의 데이터(USER_DATA) 사용하기 (0) | 2011.12.07 |