Panda3D
|
This encapsulates a SoftImage versioned filename, of the form base.v-v.ext: it consists of a directory name, a base, a major and minor version number, and an optional extension. More...
#include "softFilename.h"
Public Member Functions | |
SoftFilename (const string &dirname, const string &filename) | |
SoftFilename (const SoftFilename ©) | |
string | get_1_0_filename () const |
Returns what the filename would be if it were version 1-0. More... | |
const string & | get_base () const |
Returns the base part of the filename. More... | |
const string & | get_dirname () const |
Returns the name of the directory this file was found in. More... | |
const string & | get_extension () const |
Returns the extension part of the filename. More... | |
const string & | get_filename () const |
Returns the actual filename as found in the directory. More... | |
bool | get_in_cvs () const |
Returns true if this file is known to be entered in the CVS database, false if it is not. More... | |
int | get_major () const |
Returns the major version number. More... | |
int | get_minor () const |
Returns the minor version number. More... | |
string | get_non_extension () const |
Returns the filename part, without the extension. More... | |
int | get_use_count () const |
Returns the number of scene files that referenced this filename. More... | |
bool | get_wants_cvs () const |
Returns true if this file should be entered into the CVS database, false otherwise. More... | |
bool | has_version () const |
Returns true if the filename had a version number, false otherwise. More... | |
void | increment_use_count () |
Indicates that this filename is referenced by one more scene file. More... | |
bool | is_1_0 () const |
Returns true if this is a version 1_0 filename, false otherwise. More... | |
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. More... | |
void | make_1_0 () |
Makes this a 1_0 filename. More... | |
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. More... | |
void | operator= (const SoftFilename ©) |
void | set_in_cvs (bool in_cvs) |
Sets the flag that indicates whether this file is known to be entered into the CVS database. More... | |
void | set_wants_cvs (bool wants_cvs) |
Sets the flag that indicates whether this file should be entered into the CVS database. More... | |
This encapsulates a SoftImage versioned filename, of the form base.v-v.ext: it consists of a directory name, a base, a major and minor version number, and an optional extension.
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 31 of file softFilename.h.
string SoftFilename::get_1_0_filename | ( | ) | const |
Returns what the filename would be if it were version 1-0.
Definition at line 146 of file softFilename.cxx.
References get_base().
Referenced by has_version().
const string & SoftFilename::get_base | ( | ) | const |
Returns the base part of the filename.
This is everything before the version number.
Definition at line 158 of file softFilename.cxx.
References get_major().
Referenced by get_1_0_filename().
const string & SoftFilename::get_dirname | ( | ) | const |
Returns the name of the directory this file was found in.
Definition at line 113 of file softFilename.cxx.
References get_filename().
const string & SoftFilename::get_extension | ( | ) | const |
Returns the extension part of the filename.
This is everything after the version number.
Definition at line 192 of file softFilename.cxx.
References get_non_extension().
Referenced by get_minor().
const string & SoftFilename::get_filename | ( | ) | const |
Returns the actual filename as found in the directory.
Definition at line 124 of file softFilename.cxx.
References has_version().
Referenced by get_dirname().
bool SoftFilename::get_in_cvs | ( | ) | const |
Returns true if this file is known to be entered in the CVS database, false if it is not.
Definition at line 297 of file softFilename.cxx.
References set_wants_cvs().
Referenced by set_in_cvs().
int SoftFilename::get_major | ( | ) | const |
Returns the major version number.
Definition at line 169 of file softFilename.cxx.
References get_minor().
Referenced by get_base().
int SoftFilename::get_minor | ( | ) | const |
Returns the minor version number.
Definition at line 180 of file softFilename.cxx.
References get_extension().
Referenced by get_major().
string SoftFilename::get_non_extension | ( | ) | const |
Returns the filename part, without the extension.
Definition at line 203 of file softFilename.cxx.
References is_1_0().
Referenced by get_extension().
int SoftFilename::get_use_count | ( | ) | const |
Returns the number of scene files that referenced this filename.
Definition at line 341 of file softFilename.cxx.
Referenced by increment_use_count().
bool SoftFilename::get_wants_cvs | ( | ) | const |
Returns true if this file should be entered into the CVS database, false otherwise.
Definition at line 319 of file softFilename.cxx.
References increment_use_count().
Referenced by set_wants_cvs().
bool SoftFilename::has_version | ( | ) | const |
Returns true if the filename had a version number, false otherwise.
Definition at line 135 of file softFilename.cxx.
References get_1_0_filename().
Referenced by get_filename().
void SoftFilename::increment_use_count | ( | ) |
Indicates that this filename is referenced by one more scene file.
Definition at line 330 of file softFilename.cxx.
References get_use_count().
Referenced by get_wants_cvs().
bool SoftFilename::is_1_0 | ( | ) | const |
Returns true if this is a version 1_0 filename, false otherwise.
Definition at line 216 of file softFilename.cxx.
References make_1_0().
Referenced by get_non_extension().
bool SoftFilename::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.
Definition at line 242 of file softFilename.cxx.
References operator<().
Referenced by make_1_0().
void SoftFilename::make_1_0 | ( | ) |
Makes this a 1_0 filename.
Definition at line 227 of file softFilename.cxx.
References is_same_file().
Referenced by is_1_0().
bool SoftFilename::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.
Definition at line 256 of file softFilename.cxx.
References set_in_cvs().
Referenced by is_same_file().
void SoftFilename::set_in_cvs | ( | bool | in_cvs | ) |
Sets the flag that indicates whether this file is known to be entered into the CVS database.
Definition at line 286 of file softFilename.cxx.
References get_in_cvs().
Referenced by operator<().
void SoftFilename::set_wants_cvs | ( | bool | wants_cvs | ) |
Sets the flag that indicates whether this file should be entered into the CVS database.
Definition at line 308 of file softFilename.cxx.
References get_wants_cvs().
Referenced by get_in_cvs().