Profile.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1995-1999 DXGuide. All Rights Reserved.
- // File: Profile.h
- #ifndef _PROFILE__H
- #define _PROFILE__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- const TCHAR charLeftSect = _T('[');
- const TCHAR charRightSect = _T(']');
- const TCHAR charEqu = _T('=');
- class CPackFileManager;
- class CPackFile;
- class CProfile
- {
- public:
- CProfile(void);
- ~CProfile();
- public:
- bool Open(LPCTSTR lpszFileName,
- CPackFileManager* pPackFileManager = NULL);
- public:
- union
- {
- CFile* m_pFile;
- CPackFile* m_pPackFile;
- };
- protected:
- bool m_bUsePackFile;
- public:
- UINT GetProfileInt(LPCTSTR lpszSection,
- LPCTSTR lpszEntry, int nDefault);
- DWORD GetProfileString(LPCTSTR lpszSection,
- LPCTSTR lpszEntry, LPCTSTR lpszDefault,
- LPTSTR lpReturnedString, DWORD nSize);
- CString GetProfileString(LPCTSTR lpszSection,
- LPCTSTR lpszEntry, LPCTSTR lpszDefault = NULL);
- bool WriteProfileString(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszValue);
- bool WriteProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nValue);
- bool GotoLineNo(int nLineNo);
- int GetLine(LPTSTR lpBuffer, int nBytes);
- int GetSectionLineNo(LPCTSTR lpszSection);
- int GetNextSectionLineNo(int nLineNo);
- private:
- bool WriteLine(CFile* pFile, LPCTSTR lpBuffer);
- bool IsSpaceChar(const TCHAR chr);
- bool IsAnySection(LPTSTR lpLineBuf);
- bool IsSectionInLine(LPCTSTR lpszSection, LPTSTR lpLineBuf);
- TCHAR* GetEntryInLinePos(LPCTSTR lpszEntry, LPTSTR lpLineBuf);
- };
- #endif // _PROFILE__H