Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/cvscopy/cvsCopy.h

Go to the documentation of this file.
00001 // Filename: cvsCopy.h
00002 // Created by:  drose (31Oct00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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 //       Class : CVSCopy
00031 // Description : This is the base class for a family of programs that
00032 //               copy files, typically model files like .flt files and
00033 //               their associated textures, into a CVS-controlled
00034 //               source tree.
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

Generated on Fri May 2 03:16:58 2003 for Panda-Tool by doxygen1.3