Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SoftFilename Class Reference

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>

List of all members.

Public Member Functions

 SoftFilename (const string &dirname, const string &filename)
 SoftFilename (const SoftFilename &copy)
void operator= (const SoftFilename &copy)
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


Detailed Description

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 48 of file softFilename.h.


Constructor & Destructor Documentation

SoftFilename::SoftFilename const string &  dirname,
const string &  filename
 

Definition at line 34 of file softFilename.cxx.

References dot(), and size_t.

SoftFilename::SoftFilename const SoftFilename &  copy  ) 
 

Definition at line 83 of file softFilename.cxx.


Member Function Documentation

string SoftFilename::get_1_0_filename  )  const
 

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().

const string & SoftFilename::get_base  )  const
 

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.

const string & SoftFilename::get_dirname  )  const
 

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().

const string & SoftFilename::get_extension  )  const
 

Returns the extension part of the filename.

This is everything after the version number.

Definition at line 232 of file softFilename.cxx.

References _filename.

const string & SoftFilename::get_filename  )  const
 

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().

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 367 of file softFilename.cxx.

Referenced by SoftCVS::count_references().

int SoftFilename::get_major  )  const
 

Returns the major version number.

Definition at line 202 of file softFilename.cxx.

References _ext, _filename, _has_version, and nassertr.

int SoftFilename::get_minor  )  const
 

Returns the minor version number.

Definition at line 216 of file softFilename.cxx.

References _has_version, _major, _minor, and nassertr.

string SoftFilename::get_non_extension  )  const
 

Returns the filename part, without the extension.

Definition at line 246 of file softFilename.cxx.

References _base, and _has_version.

int SoftFilename::get_use_count  )  const
 

Returns the number of scene files that referenced this filename.

Definition at line 397 of file softFilename.cxx.

Referenced by SoftCVS::count_references().

bool SoftFilename::has_version  )  const
 

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.

void SoftFilename::increment_use_count  ) 
 

Indicates that this filename is referenced by one more scene file.

Definition at line 382 of file softFilename.cxx.

Referenced by SoftCVS::scan_cvs().

bool SoftFilename::is_1_0  )  const
 

Returns true if this is a version 1_0 filename, false otherwise.

Definition at line 263 of file softFilename.cxx.

References _has_version.

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 297 of file softFilename.cxx.

References _in_cvs.

void SoftFilename::make_1_0  ) 
 

Makes this a 1_0 filename.

Definition at line 277 of file softFilename.cxx.

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 318 of file softFilename.cxx.

References _use_count.

void SoftFilename::operator= const SoftFilename &  copy  ) 
 

Definition at line 104 of file softFilename.cxx.

References _use_count.

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 352 of file softFilename.cxx.


Member Data Documentation

string SoftFilename::_base [private]
 

Definition at line 82 of file softFilename.h.

Referenced by get_filename(), get_non_extension(), and has_version().

string SoftFilename::_dirname [private]
 

Definition at line 79 of file softFilename.h.

string SoftFilename::_ext [private]
 

Definition at line 85 of file softFilename.h.

Referenced by get_base(), get_filename(), and get_major().

string SoftFilename::_filename [private]
 

Definition at line 80 of file softFilename.h.

Referenced by get_extension(), get_major(), and has_version().

bool SoftFilename::_has_version [private]
 

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().

bool SoftFilename::_in_cvs [private]
 

Definition at line 86 of file softFilename.h.

Referenced by is_same_file().

int SoftFilename::_major [private]
 

Definition at line 83 of file softFilename.h.

Referenced by get_1_0_filename(), and get_minor().

int SoftFilename::_minor [private]
 

Definition at line 84 of file softFilename.h.

Referenced by get_minor().

int SoftFilename::_use_count [private]
 

Definition at line 87 of file softFilename.h.

Referenced by operator<(), and operator=().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:56 2003 for Panda-Tool by doxygen1.3