#include <softFilename.h>
Public Member Functions | |
SoftFilename (const string &dirname, const string &filename) | |
SoftFilename (const SoftFilename ©) | |
void | operator= (const SoftFilename ©) |
const string & | get_dirname () const |
Returns the name of the directory this file was found in. | |
const string & | get_filename () const |
Returns the actual filename as found in the directory. | |
bool | has_version () const |
Returns true if the filename had a version number, false otherwise. | |
string | get_1_0_filename () const |
Returns what the filename would be if it were version 1-0. | |
const string & | get_base () const |
Returns the base part of the filename. | |
int | get_major () const |
Returns the major version number. | |
int | get_minor () const |
Returns the minor version number. | |
const string & | get_extension () const |
Returns the extension part of the filename. | |
string | get_non_extension () const |
Returns the filename part, without the extension. | |
bool | is_1_0 () const |
Returns true if this is a version 1_0 filename, false otherwise. | |
void | make_1_0 () |
Makes this a 1_0 filename. | |
bool | is_same_file (const SoftFilename &other) const |
Returns true if this file has the same base and extension as the other, disregarding the version number; false otherwise. | |
bool | operator< (const SoftFilename &other) const |
Puts filenames in order such that the files with the same base are sorted together, ignoring extension; and within files with the same base, files are sorted in decreasing version number order so that the most recent version appears first. | |
void | set_in_cvs (bool in_cvs) |
Sets the flag that indicates whether this file is known to be entered into the CVS database. | |
bool | get_in_cvs () const |
Returns true if this file is known to be entered in the CVS database, false if it is not. | |
void | increment_use_count () |
Indicates that this filename is referenced by one more scene file. | |
int | get_use_count () const |
Returns the number of scene files that referenced this filename. | |
Private Attributes | |
string | _dirname |
string | _filename |
bool | _has_version |
string | _base |
int | _major |
int | _minor |
string | _ext |
bool | _in_cvs |
int | _use_count |
It also keeps track of whether the named file has been added to CVS, and how many scene files it is referenced by,
Definition at line 48 of file softFilename.h.
|
Definition at line 34 of file softFilename.cxx. |
|
Definition at line 83 of file softFilename.cxx. |
|
Returns what the filename would be if it were version 1-0.
Definition at line 172 of file softFilename.cxx. References _major. Referenced by SoftCVS::remove_unused_elements(). |
|
Returns the base part of the filename. This is everything before the version number. Definition at line 188 of file softFilename.cxx. References _ext, _has_version, and nassertr. |
|
Returns the name of the directory this file was found in.
Definition at line 127 of file softFilename.cxx. Referenced by SoftCVS::count_references(), and SoftCVS::remove_unused_elements(). |
|
Returns the extension part of the filename. This is everything after the version number. Definition at line 232 of file softFilename.cxx. References _filename. |
|
Returns the actual filename as found in the directory.
Definition at line 142 of file softFilename.cxx. References _base, _ext, _has_version, and nassertr. Referenced by SoftCVS::count_references(), and SoftCVS::remove_unused_elements(). |
|
Returns true if this file is known to be entered in the CVS database, false if it is not.
Definition at line 367 of file softFilename.cxx. Referenced by SoftCVS::count_references(). |
|
Returns the major version number.
Definition at line 202 of file softFilename.cxx. References _ext, _filename, _has_version, and nassertr. |
|
Returns the minor version number.
Definition at line 216 of file softFilename.cxx. References _has_version, _major, _minor, and nassertr. |
|
Returns the filename part, without the extension.
Definition at line 246 of file softFilename.cxx. References _base, and _has_version. |
|
Returns the number of scene files that referenced this filename.
Definition at line 397 of file softFilename.cxx. Referenced by SoftCVS::count_references(). |
|
Returns true if the filename had a version number, false otherwise.
Definition at line 157 of file softFilename.cxx. References _base, _filename, _has_version, and nassertr. |
|
Indicates that this filename is referenced by one more scene file.
Definition at line 382 of file softFilename.cxx. Referenced by SoftCVS::scan_cvs(). |
|
Returns true if this is a version 1_0 filename, false otherwise.
Definition at line 263 of file softFilename.cxx. References _has_version. |
|
Returns true if this file has the same base and extension as the other, disregarding the version number; false otherwise.
Definition at line 297 of file softFilename.cxx. References _in_cvs. |
|
Makes this a 1_0 filename.
Definition at line 277 of file softFilename.cxx. |
|
Puts filenames in order such that the files with the same base are sorted together, ignoring extension; and within files with the same base, files are sorted in decreasing version number order so that the most recent version appears first.
Definition at line 318 of file softFilename.cxx. References _use_count. |
|
Definition at line 104 of file softFilename.cxx. References _use_count. |
|
Sets the flag that indicates whether this file is known to be entered into the CVS database.
Definition at line 352 of file softFilename.cxx. |
|
Definition at line 82 of file softFilename.h. Referenced by get_filename(), get_non_extension(), and has_version(). |
|
Definition at line 79 of file softFilename.h. |
|
Definition at line 85 of file softFilename.h. Referenced by get_base(), get_filename(), and get_major(). |
|
Definition at line 80 of file softFilename.h. Referenced by get_extension(), get_major(), and has_version(). |
|
Definition at line 81 of file softFilename.h. Referenced by get_base(), get_filename(), get_major(), get_minor(), get_non_extension(), has_version(), and is_1_0(). |
|
Definition at line 86 of file softFilename.h. Referenced by is_same_file(). |
|
Definition at line 83 of file softFilename.h. Referenced by get_1_0_filename(), and get_minor(). |
|
Definition at line 84 of file softFilename.h. Referenced by get_minor(). |
|
Definition at line 87 of file softFilename.h. Referenced by operator<(), and operator=(). |