00001 // Filename: cvsSourceDirectory.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 CVSSOURCEDIRECTORY_H 00020 #define CVSSOURCEDIRECTORY_H 00021 00022 #include "pandatoolbase.h" 00023 #include "filename.h" 00024 00025 #include "pvector.h" 00026 00027 class CVSSourceTree; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : CVSSourceDirectory 00031 // Description : This represents one particular directory in the 00032 // hierarchy of source directory files. We must scan 00033 // the source directory to identify where the related 00034 // files have previously been copied. 00035 //////////////////////////////////////////////////////////////////// 00036 class CVSSourceDirectory { 00037 public: 00038 CVSSourceDirectory(CVSSourceTree *tree, CVSSourceDirectory *parent, 00039 const string &dirname); 00040 ~CVSSourceDirectory(); 00041 00042 string get_dirname() const; 00043 string get_fullpath() const; 00044 string get_path() const; 00045 string get_rel_to(const CVSSourceDirectory *other) const; 00046 00047 int get_num_children() const; 00048 CVSSourceDirectory *get_child(int n) const; 00049 00050 CVSSourceDirectory *find_relpath(const string &relpath); 00051 CVSSourceDirectory *find_dirname(const string &dirname); 00052 00053 public: 00054 bool scan(const Filename &directory, const string &key_filename); 00055 00056 private: 00057 CVSSourceTree *_tree; 00058 CVSSourceDirectory *_parent; 00059 string _dirname; 00060 int _depth; 00061 00062 typedef pvector<CVSSourceDirectory *> Children; 00063 Children _children; 00064 }; 00065 00066 #endif