Isis 3 Programmer Reference
Isis::FileName Class Reference

File name manipulation and expansion. More...

#include <FileName.h>

Collaboration diagram for Isis::FileName:
Collaboration graph

Classes

class  Data
 This is the reference-counted data for FileName. More...
 

Public Member Functions

 FileName ()
 Constructs an empty FileName object.
 
 FileName (const char *fileName)
 Constructs a FileName object using a char pointer as a file name.
 
 FileName (const QString &fileName)
 Constructs a FileName object using a QString as a file name.
 
 FileName (const FileName &other)
 Constructs a copy of a FileName object using another FileName object.
 
 ~FileName ()
 Destroys the FileName object.
 
QString originalPath () const
 Returns the path of the original file name.
 
QString path () const
 Returns the path of the file name.
 
QString attributes () const
 Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttributeInput or CubeAttributeOutput.
 
QString baseName () const
 Returns the name of the file without the path and without extensions.
 
QString name () const
 Returns the name of the file excluding the path and the attributes in the file name.
 
QString extension () const
 Returns the last extension of the file name.
 
QString expanded () const
 Returns a QString of the full file name including the file path, excluding the attributes.
 
QString original () const
 Returns the full file name including the file path.
 
FileName addExtension (const QString &extension) const
 Adds a new extension to the file name.
 
FileName removeExtension () const
 Removes all extensions in the file name.
 
FileName setExtension (const QString &extension) const
 Sets all current file extensions to a new extension in the file name.
 
bool isVersioned () const
 Checks to see if a file name is versioned by date or numerically.
 
bool isNumericallyVersioned () const
 Checks if the file name is versioned numerically.
 
bool isDateVersioned () const
 Checks if the file name is versioned by date.
 
FileName highestVersion () const
 Searches the directory specified in the file name for the highest version of the file name.
 
FileName newVersion () const
 Updates the file name to be the latest version.
 
bool fileExists () const
 Returns true if the file exists; false otherwise.
 
QDir dir () const
 Returns the path of the file's parent directory as a QDir object.
 
QString toString () const
 Returns a QString of the full file name including the file path, excluding the attributes with any Isis Preferences or environment variables indicated by $, changed to what they represent.
 
FileNameoperator= (const FileName &rhs)
 Clears the current contents of the FileName object and reinitializes it with the argument.
 
bool operator== (const FileName &rhs)
 Compares equality of two FileName objects.
 
bool operator!= (const FileName &rhs)
 Compares equality of two FileName objects.
 

Static Public Member Functions

static FileName createTempFile (FileName templateFileName="$TEMPORARY/temp")
 Creates a temporary file and returns a FileName object created using the temporary file.
 

Private Member Functions

FileName version (long versionNumber) const
 Returns a FileName object of the same file name but versioned numerically by the number passed in as a parameter.
 
FileName version (QDate versionDate) const
 Returns a FileName object of the same file name but versioned by the date passed in as a parameter.
 
QDate highestVersionDate () const
 This looks through the directory of the file and checks for the highest version date of the file that is versioned date.
 
long highestVersionNum () const
 This looks through the directory of the file and checks for the highest version number of the file that is versioned numerically.
 
void validateVersioningState () const
 This verifies the class invariant when using versioning - that the FileName is in an acceptable state to find file version numbers.
 
QString fileNameQDatePattern () const
 This changes the files format.
 
QPair< QString, QString > splitNameAroundVersionNum () const
 This returns a QPair of the text (before, after) a version number in a file.
 

Private Attributes

QSharedDataPointer< Datam_d
 

Detailed Description

File name manipulation and expansion.

This class is used for manipulating filenames. It allows access to the path, extension, base name and Isis attributes. A standard Isis filename takes the form of

/path/base.extension+attribute
QString path() const
Returns the path of the file name.
Definition FileName.cpp:103

For example:

/work1/mars.cub+5
Author
2002-06-11 Jeff Anderson
Todo
This class needs an example.
History

2002-11-27 Stuart Sides - added capability to expand environment variables within a filename.

2003-01-27 Jeff Anderson - added a method to allow full file specification to be extracted (includes the attributes).

2002-02-12 Stuart Sides - fixed bug with incorrect parsing when filename did not have a path.

2003-05-16 Stuart Sides - modified schema from astrogeology...isis.astrogeology.

2003-07-21 Stuart Sides - modified to use "+" as the attribute delimiter instead of a ":".

2003-10-17 ?????? - Added default constructor, operator "=" and temporary members.

2003-10-30 ?????? - Added new members: HighestVersion and Exists.

2003-12-03 ?????? - Added capability to expand Preferences in the DataDirectory group only.

2004-01-14 ?????? - Added new member OriginalPath.

2004-01-22 ?????? - Added new member Name. Name returns the filename only without any path, extension or attributes.

2004-01-27 ?????? - Tool all references to attributes out. IsisFileName now ignores all cube attributes.

2004-01-27 ?????? - Removed the member FullSpecification, because FullSpecification without the cube attributes now does the same thing as FileName.

2004-01-27 ?????? - Added a new constructor with two parameters. This new constructor will create a temporary filename using the path from the Preference DataDirectory/Temporary the filename from argument one appended with a number from 100000 to 199999 and the extension of argument two.

2004-05-17 ?????? - Added new member MakeDirectory.

2005-07-28 Drew Davidson - added new member NewVersion.

2007-10-03 Steven Koechle - Fixed Temporary() so if a path was specified it will have the cwd put on in front of it.

2009-01-07 Steven Lambright - expanded() no longer behaves differently for unit tests

2011-08-19 Jeannie Backer - Modified unitTest to use $temporary variable instead of /tmp directory. Added some documentation to methods.

2011-08-24 Steven Lambright and Tracie Sucharski - Uses QString instead of QString for simplicity when used with our GUI applications. Removed extra includes and cleaned up code a little.

2012-04-14 Steven Lambright - Renamed FileName to FileName. No longer inherits QFileInfo, paired down functionality to file name related functionality. Fixed temporary file naming to guarantee unique, unpredictable (safe) names.

2012-06-04 Steven Lambright and Stuart Sides - Added operator!= and improved unit test to include tests of operator== and operator!=. Fixes #903.

2014-07-23 Jeannie Backer - Moved ifndef to top of file to bring class closer to ISIS coding standards and removed include for std::string.

2016-06-21 Kris Becker - Properly forward declare QPair as struct not class

2017-04-21 Cole Neubauer - Updated documentation for the class Fixes #4121

2018-04-06 Kaitlyn Lee - Moved method documentation to cpp file and updated it for consistency. Fixes #5230.

2019-08-07 Jesse Mapel - Replaced QDate::fromFile call with QLocale::toDate calls to ensure US English is always used. Fixes #3340

Definition at line 100 of file FileName.h.

Constructor & Destructor Documentation

◆ FileName() [1/4]

◆ FileName() [2/4]

Isis::FileName::FileName ( const char * file)

Constructs a FileName object using a char pointer as a file name.

Parameters
filechar pointer representing new filename

Definition at line 40 of file FileName.cpp.

◆ FileName() [3/4]

Isis::FileName::FileName ( const QString & file)

Constructs a FileName object using a QString as a file name.

Parameters
fileQstring representing new filename

Definition at line 50 of file FileName.cpp.

◆ FileName() [4/4]

Isis::FileName::FileName ( const FileName & other)

Constructs a copy of a FileName object using another FileName object.

Parameters
&otherFileName object to copy.

Definition at line 60 of file FileName.cpp.

◆ ~FileName()

Isis::FileName::~FileName ( )

Destroys the FileName object.

Definition at line 66 of file FileName.cpp.

Member Function Documentation

◆ addExtension()

FileName Isis::FileName::addExtension ( const QString & newExtension) const

Adds a new extension to the file name.

If the current extension is the same as the new extension it will return an unchanged FileName object.

Parameters
newExtensionThe new file extension to be added at the end of the file name after all exisiting extensions.
Returns
FileName object with added extension

Definition at line 225 of file FileName.cpp.

References attributes(), extension(), FileName(), name(), and originalPath().

Referenced by IsisAml::GetCubeName(), IsisAml::GetFileName(), and setExtension().

◆ attributes()

QString Isis::FileName::attributes ( ) const

Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttributeInput or CubeAttributeOutput.

Filenames without any attributes return an empty QString.

  for a full file specification of:
   "/tmp/Peaks.cub+Bsq"
  attributes() gives:
   "Bsq"
Returns
QString of the attributes specified in the filename.

Definition at line 121 of file FileName.cpp.

Referenced by addExtension(), IsisAml::GetCubeName(), removeExtension(), and Isis::CubeAttribute< ChildClass >::setAttributes().

◆ baseName()

QString Isis::FileName::baseName ( ) const

Returns the name of the file without the path and without extensions.

  for a full file specification of:
   "/tmp/Peaks.cub.gz"
  baseName() gives:
   "Peaks"
Returns
QString containing every character excluding the path and all extensions.

Definition at line 145 of file FileName.cpp.

Referenced by Isis::PipelineApplication::BuildParamString(), Isis::PipelineApplication::CalculateOutputFile(), createTempFile(), Isis::Pipeline::FinalOutput(), Isis::ProcessExportPds4::identificationArea(), Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()(), and removeExtension().

◆ createTempFile()

FileName Isis::FileName::createTempFile ( FileName templateFileName = "$TEMPORARY/temp")
static

Creates a temporary file and returns a FileName object created using the temporary file.

Parameters
templateFileNamethe file name used to create the temporary file.
Returns
FileName object created using the temporary file
Exceptions
Isis::IException::Io

Definition at line 478 of file FileName.cpp.

References baseName(), extension(), FileName(), Isis::IException::Io, original(), originalPath(), and path().

Referenced by Isis::Application::GetEnviromentInfo(), Isis::Application::GetLibraryDependencies(), Isis::Application::GetSystemDiskSpace(), Isis::Application::GetUnameInfo(), and Isis::Cube::reformatOldIsisLabel().

◆ dir()

QDir Isis::FileName::dir ( ) const

◆ expanded()

QString Isis::FileName::expanded ( ) const

Returns a QString of the full file name including the file path, excluding the attributes.

Any Isis Preferences or environment variables indicated by $, are changed to what they represent.

Returns
QString
  for a full file specification of:
   QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
  expanded() gives:
   "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"

Any Isis Preferences or environment variables indicated by $, are changed to what they represent.

  for a full file specification of:
   "$ISISROOT/tmp/Peaks.cub+Bsq"
  expanded() gives:
   "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"
Returns
QString

Definition at line 196 of file FileName.cpp.

Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::add(), Isis::ImageExporter::addChannel(), Isis::CubeDataThread::AddCube(), Isis::GuiParameter::AddHelpers(), Isis::Application::Application(), Isis::Blob::Blob(), Isis::Cube::cleanUp(), Isis::MocLabels::Compute(), Isis::CorrelationMatrix::computeCorrelationMatrix(), Isis::Cube::create(), Isis::ControlPointEditWidget::createControlPoint(), Isis::ControlMeasureEditWidget::createMeasureEditor(), Isis::QnetNavTool::createNavigationDialog(), Isis::ControlPointEdit::createPointEditor(), dir(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::ProcessImportFits::extraFitsLabel(), fileExists(), Isis::Cube::fileName(), Isis::SerialNumberList::fileNameIndex(), fileNameQDatePattern(), Isis::ProcessImportFits::fitsImageLabel(), Isis::EmbreeTargetManager::fullFilePath(), IsisAml::GetCubeName(), IsisAml::GetFileName(), Isis::MosaicTool::getIcon(), Isis::GuiFileNameParameter::GuiFileNameParameter(), highestVersionDate(), highestVersionNum(), Isis::Cube::initLabelFromFile(), Isis::MocLabels::InitWago(), Isis::BundleSolutionInfo::inputControlNetFileName(), Isis::BundleSolutionInfo::inputLidarDataFileName(), isDateVersioned(), isNumericallyVersioned(), Isis::iTime::LoadLeapSecondKernel(), Isis::Mariner10Camera::Mariner10Camera(), Isis::Process::MissionData(), Isis::CubePlotCurve::mousePressEvent(), Isis::ObservationNumberList::observationNumber(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::Cube::open(), Isis::CubeManager::OpenCube(), operator==(), Isis::BundleSolutionInfo::outputHeader(), path(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::CorrelationMatrix::pvlObject(), Isis::ImageOverlapSet::ReadImageOverlaps(), Isis::Cube::realDataFileName(), Isis::Cube::reformatOldIsisLabel(), Isis::Cube::reopen(), Isis::BundleSolutionInfo::save(), Isis::GuiCubeParameter::SelectAttribute(), Isis::SerialNumberList::serialNumber(), Isis::MatchTool::serialNumberList(), Isis::CorrelationMatrix::setCovarianceFileName(), Isis::Pipeline::SetInputListFile(), Isis::MdiCubeViewport::setLinked(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), Isis::MosaicMainWindow::setupMenus(), splitNameAroundVersionNum(), Isis::ProcessMosaic::StartProcess(), Isis::Tool::Tool(), toString(), Isis::MeasureTool::updateDist(), Isis::BundleSolutionInfo::updateFileName(), Isis::AdvancedTrackTool::updateRow(), Isis::BlinkTool::updateTool(), validateVersioningState(), IsisAml::Verify(), version(), Isis::VikingCamera::VikingCamera(), Isis::WarningWidget::WarningWidget(), Isis::Cube::write(), Isis::ImageOverlapSet::WriteImageOverlaps(), and Isis::Cube::writeLabels().

◆ extension()

QString Isis::FileName::extension ( ) const

Returns the last extension of the file name.

  for a full file specification of:
   "/tmp/Peaks.cub.gz"
  extension() gives:
   "gz"
Returns
QString containing every character in the file name after the last "." character.

Definition at line 178 of file FileName.cpp.

Referenced by addExtension(), createTempFile(), setExtension(), Isis::ImportImagesWorkOrder::setupExecution(), and Isis::ImportShapesWorkOrder::setupExecution().

◆ fileExists()

◆ fileNameQDatePattern()

QString Isis::FileName::fileNameQDatePattern ( ) const
private

This changes the files format.

Specifically quotes everything not in {} with single quotes and removes the {} from the file name.

Returns
QString

Definition at line 727 of file FileName.cpp.

References expanded(), and FileName().

Referenced by highestVersionDate(), and version().

◆ highestVersion()

FileName Isis::FileName::highestVersion ( ) const

Searches the directory specified in the file name for the highest version of the file name.

Returns a FileName object with the file name changed to reflect the highest version.

Returns
FileName object

Definition at line 313 of file FileName.cpp.

References highestVersionDate(), highestVersionNum(), isDateVersioned(), isNumericallyVersioned(), isVersioned(), name(), originalPath(), Isis::IException::Unknown, validateVersioningState(), and version().

Referenced by Isis::KernelDb::files(), Isis::iTime::LoadLeapSecondKernel(), and Isis::Process::MissionData().

◆ highestVersionDate()

QDate Isis::FileName::highestVersionDate ( ) const
private

This looks through the directory of the file and checks for the highest version date of the file that is versioned date.

Returns
QDate

Definition at line 578 of file FileName.cpp.

References dir(), expanded(), FileName(), fileNameQDatePattern(), name(), path(), and Isis::IException::Unknown.

Referenced by highestVersion().

◆ highestVersionNum()

long Isis::FileName::highestVersionNum ( ) const
private

This looks through the directory of the file and checks for the highest version number of the file that is versioned numerically.

Returns
long

Definition at line 640 of file FileName.cpp.

References dir(), expanded(), FileName(), name(), path(), splitNameAroundVersionNum(), and Isis::IException::Unknown.

Referenced by highestVersion(), and newVersion().

◆ isDateVersioned()

bool Isis::FileName::isDateVersioned ( ) const

Checks if the file name is versioned by date.

Returns true if the file is versioned by date; returns false otherwise.

Returns
Boolean

Definition at line 303 of file FileName.cpp.

References expanded(), and FileName().

Referenced by highestVersion(), isVersioned(), newVersion(), and validateVersioningState().

◆ isNumericallyVersioned()

bool Isis::FileName::isNumericallyVersioned ( ) const

Checks if the file name is versioned numerically.

Returns true if the file is versioned numerically; returns false otherwise.

Returns
Boolean

Definition at line 293 of file FileName.cpp.

References expanded(), and FileName().

Referenced by highestVersion(), isVersioned(), newVersion(), and splitNameAroundVersionNum().

◆ isVersioned()

bool Isis::FileName::isVersioned ( ) const

Checks to see if a file name is versioned by date or numerically.

Returns true if file is versioned by date or numerically; returns false otherwise.

Returns
Boolean

Definition at line 281 of file FileName.cpp.

References isDateVersioned(), isNumericallyVersioned(), and validateVersioningState().

Referenced by Isis::KernelDb::files(), highestVersion(), and newVersion().

◆ name()

QString Isis::FileName::name ( ) const

Returns the name of the file excluding the path and the attributes in the file name.

  for a full file specification of:
   "/tmp/Peaks.cub+Bsq"
  name() gives:
   "Peaks.cub"
Returns
QString containing every character in the file name exluding the path and attributes of the file.

Definition at line 162 of file FileName.cpp.

Referenced by addExtension(), Isis::Directory::addTemplateEditorView(), Isis::ControlPointEditWidget::addTemplates(), Isis::Application::Application(), Isis::ControlPointEditWidget::checkReference(), Isis::QnetTool::checkReference(), Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::Control::copyToNewProjectRoot(), Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::QnetPointCubeNameFilter::createCubeList(), Isis::MatchTool::createPoint(), Isis::ControlPointEditWidget::createPointEditor(), Isis::UserInterface::evaluateOption(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::FeatureNomenclatureTool::featuresForViewportFound(), Isis::KernelDb::files(), Isis::QnetNavTool::filterList(), Isis::ControlMeasure::GetChooserName(), Isis::CorrelationMatrix::hasCovMat(), highestVersion(), highestVersionDate(), highestVersionNum(), Isis::ControlPointEditWidget::initDem(), Isis::CorrelationMatrix::isValid(), Isis::JigsawRunWidget::JigsawRunWidget(), Isis::ControlPointEditWidget::loadGroundMeasure(), Isis::QnetTool::loadGroundMeasure(), Isis::MatchTool::loadPoint(), Isis::QnetTool::loadPoint(), Isis::ControlPointEditWidget::loadPoint(), newVersion(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::QnetTool::openGround(), Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportControlNetWorkOrder::CreateControlsFunctor::operator()(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::Cube::realDataFileName(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::QnetNavTool::resetList(), Isis::BundleSolutionInfo::save(), Isis::TemplateList::save(), Isis::JigsawSetupDialog::selectControl(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), Isis::Pipeline::SetInputListFile(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ProcessMapMosaic::StartProcess(), Isis::OverlapStatistics::toPvl(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::Control::updateFileName(), Isis::Image::updateFileName(), Isis::Shape::updateFileName(), Isis::Template::updateFileName(), Isis::ControlPointEditWidget::validateMeasureChange(), version(), and Isis::Cube::writeLabels().

◆ newVersion()

FileName Isis::FileName::newVersion ( ) const

Updates the file name to be the latest version.

If the file is versioned by date the newest version will be the current date. If the file is versioned numerically, the newest version will be the current version plus one.

Returns
FileName object with the new version file name.
Exceptions
Isis::IException::Unknown

Definition at line 348 of file FileName.cpp.

References fileExists(), highestVersionNum(), isDateVersioned(), isNumericallyVersioned(), isVersioned(), name(), originalPath(), Isis::IException::Unknown, validateVersioningState(), and version().

◆ operator!=()

bool Isis::FileName::operator!= ( const FileName & rhs)

Compares equality of two FileName objects.

Returns false if the two objects are equal and true otherwise.

Parameters
rhsFileName to compare the current FileName object to.
Returns
Boolean

Definition at line 568 of file FileName.cpp.

◆ operator=()

FileName & Isis::FileName::operator= ( const FileName & rhs)

Clears the current contents of the FileName object and reinitializes it with the argument.

Parameters
rhsFileName to replace the current contents of the object.
Returns
void

Definition at line 527 of file FileName.cpp.

◆ operator==()

bool Isis::FileName::operator== ( const FileName & rhs)

Compares equality of two FileName objects.

Returns true if the two objects are equal and false otherwise.

Parameters
rhsFileName to compare the current FileName object to.
Returns
Boolean

Definition at line 540 of file FileName.cpp.

References expanded().

◆ original()

QString Isis::FileName::original ( ) const

Returns the full file name including the file path.

Returns
QString containing every character in the file name and the path
  for a full file specification of:
   QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
  original() gives:
   QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
  for a full file specification of:
   "$ISISROOT/tmp/Peaks.cub+Bsq"
  original() gives:
   "$ISISROOT/tmp/Peaks.cub+Bsq"
Returns
QString containing every character in the file name and the path

Definition at line 212 of file FileName.cpp.

Referenced by Isis::Cube::create(), createTempFile(), Isis::Cube::initLabelFromFile(), Isis::Process::MissionData(), Isis::Cube::realDataFileName(), Isis::Cube::relocateDnData(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), Isis::FileName::Data::setOriginal(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), and Isis::Cube::writeLabels().

◆ originalPath()

QString Isis::FileName::originalPath ( ) const

Returns the path of the original file name.

For *nix operating systems this includes everything up to but not including the last slash "/". For filenames created without any slashes the current working directory will be returned.

  for a full file specification of:
   "/home/me/img/picture.jpg"
  originalPath() gives:
   "/home/me/img"
Returns
QString of the path portion of the original filename.

Definition at line 84 of file FileName.cpp.

Referenced by Isis::Directory::addBundleObservationView(), addExtension(), createTempFile(), Isis::KernelDb::files(), highestVersion(), newVersion(), Isis::Cube::realDataFileName(), removeExtension(), version(), and version().

◆ path()

QString Isis::FileName::path ( ) const

◆ removeExtension()

FileName Isis::FileName::removeExtension ( ) const

Removes all extensions in the file name.

Returns
FileName object with all extensions removed

Definition at line 246 of file FileName.cpp.

References attributes(), baseName(), FileName(), and originalPath().

Referenced by setExtension(), and Isis::ProcessMosaic::StartProcess().

◆ setExtension()

FileName Isis::FileName::setExtension ( const QString & newExtension) const

Sets all current file extensions to a new extension in the file name.

Parameters
newExtensionThe new file extension to replace any current file extensions with
Returns
FileName object with all existing extensions replaced by the new extension

Definition at line 265 of file FileName.cpp.

References addExtension(), extension(), and removeExtension().

Referenced by Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::Image::deleteFromDisk(), and Isis::Shape::deleteFromDisk().

◆ splitNameAroundVersionNum()

QPair< QString, QString > Isis::FileName::splitNameAroundVersionNum ( ) const
private

This returns a QPair of the text (before, after) a version number in a file.

Before being the text before the version number and after being the text after the version number.

Returns
QPair

Definition at line 757 of file FileName.cpp.

References expanded(), FileName(), and isNumericallyVersioned().

Referenced by highestVersionNum(), and version().

◆ toString()

QString Isis::FileName::toString ( ) const

Returns a QString of the full file name including the file path, excluding the attributes with any Isis Preferences or environment variables indicated by $, changed to what they represent.

Returns
QString
  for a full file specification of:
   QString(ISISROOT) + "/tmp/Peaks.cub+Bsq"
  toString() gives:
   "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"
  for a full file specification of:
   "$ISISROOT/tmp/Peaks.cub+Bsq"
  toString() gives:
   "/usgs/pkgs/isis3/isis/tmp/Peaks.cub"
Returns
QString

Definition at line 515 of file FileName.cpp.

References expanded().

Referenced by Isis::ControlPointEditWidget::checkGroundFileLocation(), Isis::Control::copyToNewProjectRoot(), Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::ProcessImportFits::extractFitsLabels(), Isis::ProcessImportFits::extraFitsLabel(), Isis::ProcessImportFits::fitsImageLabel(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::Cube::realDataFileName(), Isis::Cube::reformatOldIsisLabel(), Isis::BundleSolutionInfo::save(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), and version().

◆ validateVersioningState()

void Isis::FileName::validateVersioningState ( ) const
private

This verifies the class invariant when using versioning - that the FileName is in an acceptable state to find file version numbers.

Definition at line 679 of file FileName.cpp.

References expanded(), FileName(), isDateVersioned(), and Isis::IException::Unknown.

Referenced by highestVersion(), isVersioned(), and newVersion().

◆ version() [1/2]

FileName Isis::FileName::version ( long versionNumber) const
private

Returns a FileName object of the same file name but versioned numerically by the number passed in as a parameter.

Parameters
versionNumbernumber to version the new FileName object
Returns
FileName object with the new version file name.
Exceptions
Isis::IException::Unknown

Definition at line 398 of file FileName.cpp.

References expanded(), FileName(), name(), originalPath(), splitNameAroundVersionNum(), and Isis::IException::Unknown.

Referenced by highestVersion(), and newVersion().

◆ version() [2/2]

FileName Isis::FileName::version ( QDate versionDate) const
private

Returns a FileName object of the same file name but versioned by the date passed in as a parameter.

Parameters
versionDateQDate to version the new FileName object
Returns
FileName object with the new version file name.

Definition at line 437 of file FileName.cpp.

References FileName(), fileNameQDatePattern(), originalPath(), and toString().

Member Data Documentation

◆ m_d

QSharedDataPointer<Data> Isis::FileName::m_d
private

Definition at line 230 of file FileName.h.


The documentation for this class was generated from the following files: