00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CVSCOPY_H
00020 #define CVSCOPY_H
00021
00022 #include "pandatoolbase.h"
00023
00024 #include "cvsSourceTree.h"
00025
00026 #include "programBase.h"
00027 #include "filename.h"
00028
00029
00030
00031
00032
00033
00034
00035
00036 class CVSCopy : public ProgramBase {
00037 public:
00038 CVSCopy();
00039
00040 CVSSourceDirectory *
00041 import(const Filename &source, void *extra_data,
00042 CVSSourceDirectory *suggested_dir);
00043
00044 bool continue_after_error();
00045
00046 protected:
00047 virtual bool handle_args(Args &args);
00048 virtual bool post_command_line();
00049
00050 virtual bool verify_file(const Filename &source, const Filename &dest,
00051 CVSSourceDirectory *dest_dir,
00052 void *extra_data);
00053 virtual bool copy_file(const Filename &source, const Filename &dest,
00054 CVSSourceDirectory *dest_dir,
00055 void *extra_data, bool new_file)=0;
00056
00057 bool verify_binary_file(Filename source, Filename dest);
00058 bool copy_binary_file(Filename source, Filename dest);
00059
00060 bool cvs_add(const Filename &filename);
00061 static string protect_from_shell(const string &source);
00062
00063 virtual string filter_filename(const string &source);
00064
00065 private:
00066 bool scan_hierarchy();
00067 bool scan_for_root(const string &dirname);
00068 string prompt(const string &message);
00069
00070 protected:
00071 bool _force;
00072 bool _interactive;
00073 bool _got_model_dirname;
00074 Filename _model_dirname;
00075 bool _got_map_dirname;
00076 Filename _map_dirname;
00077 bool _got_root_dirname;
00078 Filename _root_dirname;
00079 Filename _key_filename;
00080 bool _no_cvs;
00081 string _cvs_binary;
00082 bool _user_aborted;
00083
00084 typedef vector_string SourceFiles;
00085 SourceFiles _source_files;
00086
00087 CVSSourceTree _tree;
00088 CVSSourceDirectory *_model_dir;
00089 CVSSourceDirectory *_map_dir;
00090
00091 typedef pmap<string, CVSSourceDirectory *> CopiedFiles;
00092 CopiedFiles _copied_files;
00093 };
00094
00095 #endif