home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xprofile.h < prev    next >
C/C++ Source or Header  |  1997-02-23  |  2KB  |  43 lines

  1. #ifndef __OOL_XPROFILE_H__
  2. #define __OOL_XPROFILE_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  6. /*===========================================================================*/
  7. /*                              class: XProfile                              */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 9/96                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xobject.h"
  14. #include "xstring.h"
  15. #include "xprocess.h"
  16.  
  17. class XString;
  18.  
  19. class _export_ XProfile: public XObject
  20. {
  21.    private:
  22.       HINI hini;
  23.       XString appName;
  24.    public:
  25.       XProfile() { hini=0;}
  26.       ~XProfile( ) { if(hini) Close(); }
  27.       BOOL Open( const XProcess * proc, const char * appTitle, const char * fileName = "os2.ini" );
  28.       BOOL Close( ) { ULONG res = PrfCloseProfile( hini); hini = 0; return res;}
  29.       BOOL Read( const char * itemName, void * buffer, ULONG& size);
  30.       BOOL Read( const char * itemName, XString * string);
  31.       BOOL Read( const char * itemName, LONG& value) { ULONG size = sizeof(value); return Read(itemName, &value, size); }
  32.       BOOL Read( const char * itemName, SHORT& value) {ULONG size = sizeof(value); return Read(itemName, &value, size); }
  33.       BOOL Read( const char * itemName, BOOL& value) {ULONG size = sizeof(value); return Read(itemName, &value, size); }
  34.       BOOL Write( const char * itemName, const void * buffer, const ULONG size);
  35.       BOOL Write( const char * itemName, XString * string) { return Write(itemName, (char*) *string, string->GetLength()); }
  36.       BOOL Write( const char * itemName, LONG value) { return Write(itemName, &value, sizeof(value)); }
  37.       BOOL Write( const char * itemName, SHORT value) { return Write(itemName, &value, sizeof(value)); }
  38.       BOOL Write( const char * itemName, BOOL value) { return Write(itemName, &value, sizeof(value)); }
  39. };
  40.  
  41.  
  42. #endif
  43.