This represents one particular directory in the hierarchy of source directory files. More...
#include "cvsSourceDirectory.h"
Public Member Functions | |
CVSSourceDirectory (CVSSourceTree *tree, CVSSourceDirectory *parent, const std::string &dirname) | |
CVSSourceDirectory * | find_dirname (const std::string &dirname) |
Returns the source directory that corresponds to the given local directory name, or NULL if there is no match. More... | |
CVSSourceDirectory * | find_relpath (const std::string &relpath) |
Returns the source directory that corresponds to the given relative path from this directory, or NULL if there is no match. More... | |
CVSSourceDirectory * | get_child (int n) const |
Returns the nth subdirectory below this directory. More... | |
std::string | get_dirname () const |
Returns the local name of this particular directory. More... | |
Filename | get_fullpath () const |
Returns the full pathname to this particular directory. More... | |
int | get_num_children () const |
Returns the number of subdirectories below this directory. More... | |
Filename | get_path () const |
Returns the relative pathname to this particular directory, as seen from the root of the tree. More... | |
Filename | get_rel_to (const CVSSourceDirectory *other) const |
Returns the relative path to the other directory from this one. More... | |
bool | scan (const Filename &directory, const std::string &key_filename) |
Recursively scans the contents of the source directory. More... | |
This represents one particular directory in the hierarchy of source directory files.
We must scan the source directory to identify where the related files have previously been copied.
The tree is maintained in a case-insensitive manner, even on a non-Windows system, since you might want to eventually check out the CVS tree onto a Windows system–and if you do, you'll be sad if there are case conflicts within the tree. So we make an effort to ensure this doesn't happen by treating two files with a different case as the same file.
Definition at line 35 of file cvsSourceDirectory.h.
CVSSourceDirectory * CVSSourceDirectory::find_dirname | ( | const std::string & | dirname | ) |
Returns the source directory that corresponds to the given local directory name, or NULL if there is no match.
Definition at line 183 of file cvsSourceDirectory.cxx.
Referenced by CVSSourceTree::find_dirname().
CVSSourceDirectory * CVSSourceDirectory::find_relpath | ( | const std::string & | relpath | ) |
Returns the source directory that corresponds to the given relative path from this directory, or NULL if there is no match.
Definition at line 143 of file cvsSourceDirectory.cxx.
References find_relpath().
Referenced by CVSSourceTree::find_relpath(), and find_relpath().
CVSSourceDirectory * CVSSourceDirectory::get_child | ( | int | n | ) | const |
Returns the nth subdirectory below this directory.
Definition at line 133 of file cvsSourceDirectory.cxx.
string CVSSourceDirectory::get_dirname | ( | ) | const |
Returns the local name of this particular directory.
Definition at line 54 of file cvsSourceDirectory.cxx.
Filename CVSSourceDirectory::get_fullpath | ( | ) | const |
Returns the full pathname to this particular directory.
Definition at line 62 of file cvsSourceDirectory.cxx.
References CVSSourceTree::get_root_fullpath().
int CVSSourceDirectory::get_num_children | ( | ) | const |
Returns the number of subdirectories below this directory.
Definition at line 125 of file cvsSourceDirectory.cxx.
Filename CVSSourceDirectory::get_path | ( | ) | const |
Returns the relative pathname to this particular directory, as seen from the root of the tree.
Definition at line 74 of file cvsSourceDirectory.cxx.
Filename CVSSourceDirectory::get_rel_to | ( | const CVSSourceDirectory * | other | ) | const |
Returns the relative path to the other directory from this one.
This does not include a trailing slash.
Definition at line 86 of file cvsSourceDirectory.cxx.
bool CVSSourceDirectory::scan | ( | const Filename & | directory, |
const std::string & | key_filename | ||
) |
Recursively scans the contents of the source directory.
Fullpath is the full path name to the directory; key_filename is the name of a file that must exist in each subdirectory for it to be considered part of the hierarchy. Returns true on success, false on failure.
Definition at line 206 of file cvsSourceDirectory.cxx.
References Filename::scan_directory().