Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / tt / bin / shell / remover.h
1 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
2 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
3 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
4 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
5 /*%%  $XConsortium: remover.h /main/3 1995/10/20 16:36:57 rswiston $                                                     */
6 /*
7  * remover.h - Interface to remover, an LS/TT-aware rm(1) and rmdir(1).
8  *
9  * Copyright (c) 1990 by Sun Microsystems, Inc.
10  *
11  */
12
13 #ifndef _REMOVER_H
14 #define _REMOVER_H
15
16 #include <api/c/tt_c.h>
17 #include <util/tt_string.h>
18
19 class remover : public _Tt_object {
20     public:
21         remover( char *arg0 );
22         virtual ~remover();
23
24         int                     do_rm();
25         Tt_status               do_ttrm();
26         bool_t                  can_rm( _Tt_string path );
27         Tt_status               open_tt();
28         Tt_status               close_tt();
29         void                    parse_args( int argc, char **argv );
30         void                    usage( FILE *fs = stderr ) const;
31         bool_t                  should_rm() { return _should_rm; }
32         bool_t                  force() { return _force; }
33         bool_t                  tt_opened() { return _tt_opened; }
34
35     private:
36         Tt_status               _ttrm_paths( _Tt_string_list_ptr paths );
37         void                    _parse_arg( char *arg );
38
39         _Tt_string              _process_name;
40         _Tt_string              _prog_name;
41         _Tt_string              _process_id;
42         _Tt_string_list_ptr     _args;
43         bool_t                  _should_rm;
44         bool_t                  _force;
45         bool_t                  _recurse;
46         bool_t                  _am_rmdir;
47         bool_t                  _tt_opened;
48         _Tt_string_list_ptr     _paths;
49 };
50
51 #endif /* _REMOVER_H */