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

pandatool/src/cvscopy/cvsSourceTree.h

Go to the documentation of this file.
00001 // Filename: cvsSourceTree.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 CVSSOURCETREE_H
00020 #define CVSSOURCETREE_H
00021 
00022 #include "pandatoolbase.h"
00023 
00024 #include "pvector.h"
00025 #include "pmap.h"
00026 #include "filename.h"
00027 
00028 class CVSSourceDirectory;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : CVSSourceTree
00032 // Description : This represents the root of the tree of source
00033 //               directory files.
00034 ////////////////////////////////////////////////////////////////////
00035 class CVSSourceTree {
00036 public:
00037   CVSSourceTree();
00038   ~CVSSourceTree();
00039 
00040   void set_root(const Filename &root_path);
00041   bool scan(const Filename &key_filename);
00042 
00043   CVSSourceDirectory *get_root() const;
00044   CVSSourceDirectory *find_directory(const Filename &path);
00045   CVSSourceDirectory *find_relpath(const string &relpath);
00046   CVSSourceDirectory *find_dirname(const string &dirname);
00047 
00048   CVSSourceDirectory *choose_directory(const Filename &filename,
00049                                        CVSSourceDirectory *suggested_dir,
00050                                        bool force, bool interactive);
00051 
00052   Filename get_root_fullpath();
00053   Filename get_root_dirname() const;
00054 
00055   static bool temp_chdir(const Filename &path);
00056   static void restore_cwd();
00057 
00058 public:
00059   void add_file(const Filename &filename, CVSSourceDirectory *dir);
00060 
00061 private:
00062   typedef pvector<CVSSourceDirectory *> Directories;
00063 
00064   CVSSourceDirectory *
00065   prompt_user(const string &filename, CVSSourceDirectory *suggested_dir,
00066               const Directories &dirs, bool force, bool interactive);
00067 
00068   CVSSourceDirectory *ask_existing(const string &filename,
00069                                    CVSSourceDirectory *dir);
00070   CVSSourceDirectory *ask_existing(const string &filename,
00071                                    const Directories &dirs,
00072                                    CVSSourceDirectory *suggested_dir);
00073   CVSSourceDirectory *ask_new(const string &filename, CVSSourceDirectory *dir);
00074   CVSSourceDirectory *ask_any(const string &filename);
00075 
00076   string prompt(const string &message);
00077 
00078   static Filename get_actual_fullpath(const Filename &path);
00079   static Filename get_start_fullpath();
00080 
00081 private:
00082   Filename _path;
00083   CVSSourceDirectory *_root;
00084 
00085   typedef pmap<Filename, Directories> Filenames;
00086   Filenames _filenames;
00087 
00088   static bool _got_start_fullpath;
00089   static Filename _start_fullpath;
00090   bool _got_root_fullpath;
00091   Filename _root_fullpath;
00092 };
00093 
00094 #endif

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