home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1999 October / VPR9910A.BIN / OLS / unrar32005 / unrar32005.lzh / src / mapf.h < prev    next >
C/C++ Source or Header  |  1998-04-03  |  1KB  |  44 lines

  1. /*
  2.  *   Copyright (c) 1998 T. Kamei (kamei@jsdlab.co.jp)
  3.  *
  4.  *   Permission to use, copy, modify, and distribute this software
  5.  * and its documentation for any purpose is hereby granted provided
  6.  * that the above copyright notice and this permission notice appear
  7.  * in all copies of the software and related documentation.
  8.  *
  9.  *                          NO WARRANTY
  10.  *
  11.  *   THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY WARRANTIES;
  12.  * WITHOUT EVEN THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
  13.  * FOR A PARTICULAR PURPOSE.
  14.  */
  15.  
  16. #ifndef _MAPF_H_
  17. # define _MAPF_H_
  18.  
  19. class mapf
  20. {
  21.   HANDLE mf_hf;
  22.   HANDLE mf_hm;
  23.   DWORD mf_size;
  24.   void *mf_base;
  25.  
  26.   void init ()
  27.     {
  28.       mf_hf = INVALID_HANDLE_VALUE;
  29.       mf_hm = 0;
  30.       mf_base = 0;
  31.       mf_size = 0;
  32.     }
  33.  
  34. public:
  35.   mapf () {init ();}
  36.   ~mapf () {close ();}
  37.   void close ();
  38.   int open (const char *, int = FILE_FLAG_SEQUENTIAL_SCAN);
  39.   const void *base () const {return mf_base;}
  40.   DWORD size () const {return mf_size;}
  41.   operator HANDLE () const {return mf_hf;}
  42. };
  43. #endif
  44.