#include <cvsSourceTree.h>
Public Member Functions | |
CVSSourceTree () | |
~CVSSourceTree () | |
void | set_root (const Filename &root_path) |
Sets the root of the source directory. | |
bool | scan (const Filename &key_filename) |
Scans the complete source directory starting at the indicated pathname. | |
CVSSourceDirectory * | get_root () const |
Returns the root directory of the hierarchy. | |
CVSSourceDirectory * | find_directory (const Filename &path) |
Returns the source directory that corresponds to the given path, or NULL if there is no such directory in the source tree. | |
CVSSourceDirectory * | find_relpath (const string &relpath) |
Returns the source directory that corresponds to the given relative path from the root, or NULL if there is no match. | |
CVSSourceDirectory * | find_dirname (const string &dirname) |
Returns the source directory that corresponds to the given local directory name, or NULL if there is no match. | |
CVSSourceDirectory * | choose_directory (const Filename &filename, CVSSourceDirectory *suggested_dir, bool force, bool interactive) |
Determines where an externally referenced model file of the indicated name should go. | |
Filename | get_root_fullpath () |
Returns the full path from the root to the top of the source hierarchy. | |
Filename | get_root_dirname () const |
Returns the local directory name of the root of the tree. | |
void | add_file (const Filename &filename, CVSSourceDirectory *dir) |
Adds a new file to the set of known files. | |
Static Public Member Functions | |
bool | temp_chdir (const Filename &path) |
Temporarily changes the current directory to the named path. | |
void | restore_cwd () |
Restores the current directory after changing it from temp_chdir(). | |
Private Types | |
typedef pvector< CVSSourceDirectory * > | Directories |
typedef pmap< Filename, Directories > | Filenames |
Private Member Functions | |
CVSSourceDirectory * | prompt_user (const string &filename, CVSSourceDirectory *suggested_dir, const Directories &dirs, bool force, bool interactive) |
Prompts the user, if necessary, to choose a directory to import the given file into. | |
CVSSourceDirectory * | ask_existing (const string &filename, CVSSourceDirectory *dir) |
Asks the user if he wants to replace an existing file. | |
CVSSourceDirectory * | ask_existing (const string &filename, const Directories &dirs, CVSSourceDirectory *suggested_dir) |
Asks the user which of several existing files he wants to replace. | |
CVSSourceDirectory * | ask_new (const string &filename, CVSSourceDirectory *dir) |
Asks the user if he wants to replace an existing file. | |
CVSSourceDirectory * | ask_any (const string &filename) |
Asks the user to type in the name of the directory in which to store the file. | |
string | prompt (const string &message) |
Issues a prompt to the user and waits for a typed response. | |
Static Private Member Functions | |
Filename | get_actual_fullpath (const Filename &path) |
Determines the actual full path from the root to the named directory. | |
Filename | get_start_fullpath () |
Returns the full path from the root to the directory in which the user started the program. | |
Private Attributes | |
Filename | _path |
CVSSourceDirectory * | _root |
Filenames | _filenames |
bool | _got_root_fullpath |
Filename | _root_fullpath |
Static Private Attributes | |
bool | _got_start_fullpath = false |
Filename | _start_fullpath |
Definition at line 42 of file cvsSourceTree.h.
|
Definition at line 69 of file cvsSourceTree.h. |
|
Definition at line 92 of file cvsSourceTree.h. |
|
Definition at line 49 of file cvsSourceTree.cxx. |
|
Definition at line 62 of file cvsSourceTree.cxx. References _path, Filename::empty(), and nassertv. |
|
Adds a new file to the set of known files. This is normally called from CVSSourceDirectory::scan() and should not be called directly by the user. Definition at line 293 of file cvsSourceTree.cxx. |
|
Asks the user to type in the name of the directory in which to store the file.
Definition at line 530 of file cvsSourceTree.cxx. |
|
Asks the user which of several existing files he wants to replace.
Definition at line 440 of file cvsSourceTree.cxx. References find_directory(), find_dirname(), find_relpath(), nassertr, nout, NULL, and prompt(). |
|
Asks the user if he wants to replace an existing file.
Definition at line 411 of file cvsSourceTree.cxx. References CVSSourceDirectory::get_path(), nassertr, nout, NULL, and prompt(). |
|
Asks the user if he wants to replace an existing file.
Definition at line 501 of file cvsSourceTree.cxx. References Filename::make_canonical(), and path. |
|
Determines where an externally referenced model file of the indicated name should go. It does this by looking for an existing model file of the same name; if a matching model is not found, or if multiple matching files are found, prompts the user for the directory, or uses suggested_dir. Definition at line 225 of file cvsSourceTree.cxx. |
|
Returns the source directory that corresponds to the given path, or NULL if there is no such directory in the source tree.
Definition at line 134 of file cvsSourceTree.cxx. References _root, CVSSourceDirectory::find_relpath(), CVSSourceDirectory::get_dirname(), NULL, and size_t. Referenced by ask_existing(), and CVSCopy::handle_args(). |
|
Returns the source directory that corresponds to the given local directory name, or NULL if there is no match.
Definition at line 202 of file cvsSourceTree.cxx. References _got_root_fullpath, _path, _root_fullpath, Filename::empty(), Filename, get_actual_fullpath(), and nassertr. Referenced by ask_existing(). |
|
Returns the source directory that corresponds to the given relative path from the root, or NULL if there is no match. The relative path may or may not include the name of the root directory itself. Definition at line 167 of file cvsSourceTree.cxx. Referenced by ask_existing(). |
|
Determines the actual full path from the root to the named directory.
Definition at line 603 of file cvsSourceTree.cxx. Referenced by find_dirname(), and scan(). |
|
Returns the root directory of the hierarchy.
Definition at line 117 of file cvsSourceTree.cxx. References NULL. |
|
Returns the local directory name of the root of the tree.
Definition at line 275 of file cvsSourceTree.cxx. |
|
Returns the full path from the root to the top of the source hierarchy.
Definition at line 255 of file cvsSourceTree.cxx. Referenced by CVSSourceDirectory::get_dirname(), scan(), and set_root(). |
|
Returns the full path from the root to the directory in which the user started the program.
Definition at line 621 of file cvsSourceTree.cxx. |
|
Issues a prompt to the user and waits for a typed response. Returns the response (which will not be empty). Definition at line 568 of file cvsSourceTree.cxx. Referenced by ask_existing(), prompt_user(), and restore_cwd(). |
|
Prompts the user, if necessary, to choose a directory to import the given file into.
Definition at line 359 of file cvsSourceTree.cxx. References CVSSourceDirectory::get_path(), nassertr, nout, NULL, and prompt(). |
|
Restores the current directory after changing it from temp_chdir().
Definition at line 335 of file cvsSourceTree.cxx. References CVSSourceDirectory::get_path(), nassertr, nout, NULL, and prompt(). |
|
Scans the complete source directory starting at the indicated pathname. It is an error to call this more than once. Returns true on success, false if there is an error. Definition at line 101 of file cvsSourceTree.cxx. References get_actual_fullpath(), get_root_fullpath(), and path. |
|
Sets the root of the source directory. This must be called before scan(), and should not be called more than once. Definition at line 81 of file cvsSourceTree.cxx. References _path, _root, Filename::get_basename(), get_root_fullpath(), nassertr, NULL, and CVSSourceDirectory::scan(). |
|
Temporarily changes the current directory to the named path. Returns true on success, false on failure. Call restore_cwd() to restore to the original directory later. Definition at line 312 of file cvsSourceTree.cxx. |
|
Definition at line 93 of file cvsSourceTree.h. |
|
Definition at line 97 of file cvsSourceTree.h. Referenced by find_dirname(). |
|
Definition at line 38 of file cvsSourceTree.cxx. |
|
Definition at line 89 of file cvsSourceTree.h. Referenced by find_dirname(), set_root(), and ~CVSSourceTree(). |
|
Definition at line 90 of file cvsSourceTree.h. Referenced by CVSSourceTree(), find_directory(), and set_root(). |
|
Definition at line 98 of file cvsSourceTree.h. Referenced by find_dirname(). |
|
Definition at line 39 of file cvsSourceTree.cxx. |