00001 // Filename: softCVS.h 00002 // Created by: drose (10Nov00) 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 SOFTCVS_H 00020 #define SOFTCVS_H 00021 00022 #include <pandatoolbase.h> 00023 00024 #include "softFilename.h" 00025 00026 #include <programBase.h> 00027 #include <vector_string.h> 00028 #include <filename.h> 00029 00030 #include "pvector.h" 00031 #include "pset.h" 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Class : SoftCVS 00035 // Description : This program prepares a SoftImage database for CVS by 00036 // renaming everything to version 1-0, and adding new 00037 // files to CVS. 00038 //////////////////////////////////////////////////////////////////// 00039 class SoftCVS : public ProgramBase { 00040 public: 00041 SoftCVS(); 00042 00043 void run(); 00044 00045 private: 00046 typedef pvector<SoftFilename> SceneFiles; 00047 typedef pmultiset<SoftFilename> ElementFiles; 00048 00049 void traverse_root(); 00050 void traverse_subdir(const Filename &directory); 00051 00052 void collapse_scene_files(); 00053 void count_references(); 00054 void remove_unused_elements(); 00055 00056 bool rename_file(SceneFiles::iterator begin, SceneFiles::iterator end); 00057 bool scan_cvs(const string &dirname, pset<string> &cvs_elements); 00058 00059 void scan_scene_file(istream &in); 00060 00061 bool cvs_add(const string &path); 00062 bool cvs_add_or_remove(const string &cvs_command, 00063 const vector_string &paths); 00064 00065 SceneFiles _scene_files; 00066 ElementFiles _element_files; 00067 00068 vector_string _cvs_add; 00069 vector_string _cvs_remove; 00070 00071 protected: 00072 bool _no_cvs; 00073 string _cvs_binary; 00074 }; 00075 00076 #endif