Panda3D
cvsCopy.h
1 // Filename: cvsCopy.h
2 // Created by: drose (31Oct00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CVSCOPY_H
16 #define CVSCOPY_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "cvsSourceTree.h"
21 
22 #include "programBase.h"
23 #include "filename.h"
24 #include "pvector.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : CVSCopy
28 // Description : This is the base class for a family of programs that
29 // copy files, typically model files like .flt files and
30 // their associated textures, into a CVS-controlled
31 // source tree.
32 ////////////////////////////////////////////////////////////////////
33 class CVSCopy : public ProgramBase {
34 public:
35  CVSCopy();
36 
38  import(const Filename &source, void *extra_data,
39  CVSSourceDirectory *suggested_dir);
40 
41  bool continue_after_error();
42 
43 protected:
44  virtual bool handle_args(Args &args);
45  virtual bool post_command_line();
46 
47  virtual bool verify_file(const Filename &source, const Filename &dest,
48  CVSSourceDirectory *dest_dir,
49  void *extra_data);
50  virtual bool copy_file(const Filename &source, const Filename &dest,
51  CVSSourceDirectory *dest_dir,
52  void *extra_data, bool new_file)=0;
53 
54  bool verify_binary_file(Filename source, Filename dest);
55  bool copy_binary_file(Filename source, Filename dest);
56 
57  bool cvs_add(const Filename &filename);
58  static string protect_from_shell(const string &source);
59 
60  virtual string filter_filename(const string &source);
61 
62 private:
63  bool scan_hierarchy();
64  bool scan_for_root(const string &dirname);
65  string prompt(const string &message);
66 
67 protected:
68  bool _force;
69  bool _interactive;
70  bool _got_model_dirname;
71  Filename _model_dirname;
72  bool _got_map_dirname;
73  Filename _map_dirname;
74  bool _got_root_dirname;
75  Filename _root_dirname;
76  Filename _key_filename;
77  bool _no_cvs;
78  string _cvs_binary;
79  bool _user_aborted;
80 
82  SourceFiles _source_files;
83 
84  CVSSourceTree _tree;
85  CVSSourceDirectory *_model_dir;
86  CVSSourceDirectory *_map_dir;
87 
89  CopiedFiles _copied_files;
90 };
91 
92 #endif
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:37
This is the base class for a family of programs that copy files, typically model files like ...
Definition: cvsCopy.h:33
This represents one particular directory in the hierarchy of source directory files.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This represents the root of the tree of source directory files.
Definition: cvsSourceTree.h:39
bool continue_after_error()
Prompts the user (unless -f was specified) if he wants to continue the copy operation after some erro...
Definition: cvsCopy.cxx:168