Panda3D
|
00001 // Filename: softCVS.h 00002 // Created by: drose (10Nov00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef SOFTCVS_H 00016 #define SOFTCVS_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "softFilename.h" 00021 00022 #include "programBase.h" 00023 #include "vector_string.h" 00024 #include "filename.h" 00025 00026 #include "pvector.h" 00027 #include "pset.h" 00028 00029 class Multifile; 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Class : SoftCVS 00033 // Description : This program prepares a SoftImage database for CVS by 00034 // renaming everything to version 1-0, and adding new 00035 // files to CVS. 00036 //////////////////////////////////////////////////////////////////// 00037 class SoftCVS : public ProgramBase { 00038 public: 00039 SoftCVS(); 00040 00041 void run(); 00042 00043 private: 00044 typedef pvector<SoftFilename> SceneFiles; 00045 typedef pmultiset<SoftFilename> ElementFiles; 00046 00047 void traverse_root(); 00048 void traverse_subdir(const Filename &directory); 00049 00050 void collapse_scene_files(); 00051 bool get_scenes(); 00052 void remove_unused_elements(); 00053 00054 bool rename_file(SceneFiles::iterator begin, SceneFiles::iterator end); 00055 bool scan_cvs(const string &dirname, pset<string> &cvs_elements); 00056 bool scan_scene_file(istream &in, Multifile &multifile); 00057 00058 bool cvs_add(const string &path); 00059 bool cvs_add_or_remove(const string &cvs_command, 00060 const vector_string &paths); 00061 00062 SceneFiles _scene_files; 00063 ElementFiles _element_files; 00064 vector_string _global_files; 00065 00066 vector_string _cvs_add; 00067 vector_string _cvs_remove; 00068 00069 bool _no_cvs; 00070 string _cvs_binary; 00071 }; 00072 00073 #endif