home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1999 October / VPR9910A.BIN / OLS / unrar32005 / unrar32005.lzh / src / rar.h < prev    next >
C/C++ Source or Header  |  1998-03-23  |  2KB  |  81 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 _rar_h_
  17. # define _rar_h_
  18.  
  19. class UnRAR
  20. {
  21. public:
  22.   enum unrar_update_type
  23.     {UT_ASK, UT_OVWRT, UT_SKIP, UT_NEWER, UT_EXISTING};
  24.  
  25.   enum unrar_cmd
  26.     {
  27.       C_NOTDEF,
  28.       C_EXTRACT,
  29.       C_EXTRACT_NODIR,
  30.       C_TEST,
  31.       C_PRINT,
  32.       C_LIST,
  33.       C_VLIST,
  34.       C_COMMENT
  35.     };
  36.  
  37.   enum unrar_opt
  38.     {
  39.       O_RECURSIVE = 1,
  40.       O_YES = 2,
  41.       O_VOLUME = 4,
  42.       O_STRICT = 8
  43.     };
  44. private:
  45.   unrar_cmd u_cmd;
  46.   unrar_update_type u_type;
  47.   int u_opt;
  48.   const char *u_path;
  49.   const char *u_dest;
  50.   const char *u_passwd;
  51.  
  52.   HWND u_hwnd;
  53.  
  54.   ostrbuf &u_ostr;
  55.   glob u_glob;
  56.  
  57.   int mkdirhier (const char *);
  58.   int check_timestamp (const char *, const RARHeaderData &);
  59.   int parse_opt (int, char **);
  60.   int extract (rarData &, const char *, const RARHeaderData &,
  61.                const class progress_dlg &);
  62.   int extract ();
  63.   int print ();
  64.   int list ();
  65.   int test ();
  66.   int comment ();
  67.  
  68.   int format (const char *, ...) const;
  69.   int format (int, ...) const;
  70.  
  71.   int open_err (int) const;
  72.   int header_err (int) const;
  73.   int process_err (int, const char *) const;
  74.  
  75. public:
  76.   int xmain (int, char **);
  77.   UnRAR (HWND hwnd, ostrbuf &ostr) : u_hwnd (hwnd), u_ostr (ostr) {}
  78. };
  79.  
  80. #endif
  81.