home *** CD-ROM | disk | FTP | other *** search
/ PC Administrator / spravce.iso / TaskModule / src / Inifile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-08-29  |  2.7 KB  |  64 lines

  1. // IniFile.h: interface for the CIniFile class.
  2. //
  3. // Created: 04/01/2001 {mm/dm/yyyyy}
  4. // Written by: Anish Mistry http://am-productions.yi.org/
  5. /*
  6. Copyright 2001 Anish Mistry. All rights reserved.
  7.  
  8. Redistribution and use in source and binary forms, with or without modification,
  9. are permitted provided that the following conditions are met:
  10.  
  11.    1. Redistributions of source code must retain the above copyright notice, 
  12.    this list of conditions and the following disclaimer.
  13.    2. Redistributions in binary form must reproduce the above copyright notice,
  14.    this list of conditions and the following disclaimer in the documentation 
  15.    and/or other materials provided with the distribution.
  16.  
  17. THIS SOFTWARE IS PROVIDED BY ANISH MISTRY ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  18. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
  19. AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 
  20. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  21. OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  22. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  24. TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26.  
  27. The views and conclusions contained in the software and documentation are those
  28. of the authors and should not be interpreted as representing official policies,
  29. either expressed or implied, of Anish Mistry or AM Productions.
  30.  
  31. * Variation of the FreeBSD License. http://www.freebsd.org/copyright/freebsd-license.html
  32. */
  33. //////////////////////////////////////////////////////////////////////
  34.  
  35.  
  36. #if !defined(AFX_INIFILE_H__2A13E091_A467_441B_89C3_9D2D49B86DDE__INCLUDED_)
  37. #define AFX_INIFILE_H__2A13E091_A467_441B_89C3_9D2D49B86DDE__INCLUDED_
  38.  
  39. #if _MSC_VER > 1000
  40. #pragma once
  41. #endif // _MSC_VER > 1000
  42.  
  43. #define MAX_PATH_LENGTH 1024
  44.  
  45. class CIniFile  
  46. {
  47. public:
  48.     unsigned long int ReadKey(const char *pSection, const char *pKey, const char *pDefault,char *pOutputBuffer,unsigned long int nOutputBufferLength);
  49.     int ReadKey(const char *pSection, const char *pKey, int nDefault);
  50.     void SetFile(const char *pFileName);
  51.     BOOL WriteKey(const char *pSection,const char *pKey,const char *pData);
  52.     int WriteKey(const char *pSection, const char *pKey, int nData);
  53.     const char *GetFileName();
  54.     const char *GetFilePath();
  55.     CIniFile();
  56.     virtual ~CIniFile();
  57.  
  58. protected:
  59.     char *m_pFileName;
  60.     char *m_pFilePath;
  61. };
  62.  
  63. #endif // !defined(AFX_INIFILE_H__2A13E091_A467_441B_89C3_9D2D49B86DDE__INCLUDED_)
  64.