home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 July / VPR0207A.ISO / OLS / UNRAR32007 / unrar32007.lzh / src.lzh / src / rar.h < prev    next >
C/C++ Source or Header  |  2001-01-11  |  2KB  |  84 lines

  1. /*
  2.  *   Copyright (c) 1998-2001 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_STRICT = 8
  42.     };
  43. private:
  44.   unrar_cmd u_cmd;
  45.   unrar_update_type u_type;
  46.   int u_opt;
  47.   const char *u_path;
  48.   const char *u_dest;
  49.   const char *u_passwd;
  50.  
  51.   HWND u_hwnd;
  52.  
  53.   ostrbuf &u_ostr;
  54.   glob u_glob;
  55.   EXTRACTINGINFOEX u_ex;
  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.                class progress_dlg &);
  62.   int extract ();
  63.   int extract1 ();
  64.   int print ();
  65.   int list ();
  66.   int test ();
  67.   int comment ();
  68.  
  69.   int format (const char *, ...) const;
  70.   int format (int, ...) const;
  71.  
  72.   int open_err (int) const;
  73.   int header_err (int) const;
  74.   int process_err (int, const char *) const;
  75.   int canceled () const;
  76.   int skip (rarData &rd, const char *path) const;
  77.  
  78. public:
  79.   int xmain (int, char **);
  80.   UnRAR (HWND hwnd, ostrbuf &ostr) : u_hwnd (hwnd), u_ostr (ostr) {}
  81. };
  82.  
  83. #endif
  84.