Panda3D
cvsSourceDirectory.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file cvsSourceDirectory.h
10  * @author drose
11  * @date 2000-10-31
12  */
13 
14 #ifndef CVSSOURCEDIRECTORY_H
15 #define CVSSOURCEDIRECTORY_H
16 
17 #include "pandatoolbase.h"
18 #include "filename.h"
19 
20 #include "pvector.h"
21 
22 class CVSSourceTree;
23 
24 /**
25  * This represents one particular directory in the hierarchy of source
26  * directory files. We must scan the source directory to identify where the
27  * related files have previously been copied.
28  *
29  * The tree is maintained in a case-insensitive manner, even on a non-Windows
30  * system, since you might want to eventually check out the CVS tree onto a
31  * Windows system--and if you do, you'll be sad if there are case conflicts
32  * within the tree. So we make an effort to ensure this doesn't happen by
33  * treating two files with a different case as the same file.
34  */
36 public:
38  const std::string &dirname);
40 
41  std::string get_dirname() const;
42  Filename get_fullpath() const;
43  Filename get_path() const;
44  Filename get_rel_to(const CVSSourceDirectory *other) const;
45 
46  int get_num_children() const;
47  CVSSourceDirectory *get_child(int n) const;
48 
49  CVSSourceDirectory *find_relpath(const std::string &relpath);
50  CVSSourceDirectory *find_dirname(const std::string &dirname);
51 
52 public:
53  bool scan(const Filename &directory, const std::string &key_filename);
54 
55 private:
56  CVSSourceTree *_tree;
57  CVSSourceDirectory *_parent;
58  std::string _dirname;
59  int _depth;
60 
62  Children _children;
63 };
64 
65 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_num_children() const
Returns the number of subdirectories below this directory.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::string get_dirname() const
Returns the local name of this particular directory.
Filename get_rel_to(const CVSSourceDirectory *other) const
Returns the relative path to the other directory from this one.
bool scan(const Filename &directory, const std::string &key_filename)
Recursively scans the contents of the source directory.
Filename get_path() const
Returns the relative pathname to this particular directory, as seen from the root of the tree.
Filename get_fullpath() const
Returns the full pathname to this particular directory.
This represents one particular directory in the hierarchy of source directory files.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
This represents the root of the tree of source directory files.
Definition: cvsSourceTree.h:34
CVSSourceDirectory * find_dirname(const std::string &dirname)
Returns the source directory that corresponds to the given local directory name, or NULL if there is ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CVSSourceDirectory * find_relpath(const std::string &relpath)
Returns the source directory that corresponds to the given relative path from this directory,...
CVSSourceDirectory * get_child(int n) const
Returns the nth subdirectory below this directory.