![]() |
Isis 3 Programmer Reference
|
File name manipulation and expansion. More...
#include <FileName.h>
Classes | |
class | Data |
This is the reference-counted data for FileName. More... | |
Public Member Functions | |
FileName () | |
Constructs an empty FileName object. More... | |
FileName (const char *fileName) | |
Constructs a FileName object using a char pointer as a file name. More... | |
FileName (const QString &fileName) | |
Constructs a FileName object using a QString as a file name. More... | |
FileName (const FileName &other) | |
Constructs a copy of a FileName object using another FileName object. More... | |
~FileName () | |
Destroys the FileName object. More... | |
QString | originalPath () const |
Returns the path of the original file name. More... | |
QString | path () const |
Returns the path of the file name. More... | |
QString | attributes () const |
Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttributeInput or CubeAttributeOutput. More... | |
QString | baseName () const |
Returns the name of the file without the path and without extensions. More... | |
QString | name () const |
Returns the name of the file excluding the path and the attributes in the file name. More... | |
QString | extension () const |
Returns the last extension of the file name. More... | |
QString | expanded () const |
Returns a QString of the full file name including the file path, excluding the attributes. More... | |
QString | original () const |
Returns the full file name including the file path. More... | |
FileName | addExtension (const QString &extension) const |
Adds a new extension to the file name. More... | |
FileName | removeExtension () const |
Removes all extensions in the file name. More... | |
FileName | setExtension (const QString &extension) const |
Sets all current file extensions to a new extension in the file name. More... | |
bool | isVersioned () const |
Checks to see if a file name is versioned by date or numerically. More... | |
bool | isNumericallyVersioned () const |
Checks if the file name is versioned numerically. More... | |
bool | isDateVersioned () const |
Checks if the file name is versioned by date. More... | |
FileName | highestVersion () const |
Searches the directory specified in the file name for the highest version of the file name. More... | |
FileName | newVersion () const |
Updates the file name to be the latest version. More... | |
bool | fileExists () const |
Returns true if the file exists; false otherwise. More... | |
QDir | dir () const |
Returns the path of the file's parent directory as a QDir object. More... | |
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. More... | |
FileName & | operator= (const FileName &rhs) |
Clears the current contents of the FileName object and reinitializes it with the argument. More... | |
bool | operator== (const FileName &rhs) |
Compares equality of two FileName objects. More... | |
bool | operator!= (const FileName &rhs) |
Compares equality of two FileName objects. More... | |
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. More... | |
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. More... | |
FileName | version (QDate versionDate) const |
Returns a FileName object of the same file name but versioned by the date passed in as a parameter. More... | |
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. More... | |
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. More... | |
void | validateVersioningState () const |
This verifies the class invariant when using versioning - that the FileName is in an acceptable state to find file version numbers. More... | |
QString | fileNameQDatePattern () const |
This changes the files format. More... | |
QPair< QString, QString > | splitNameAroundVersionNum () const |
This returns a QPair of the text (before, after) a version number in a file. More... | |
Private Attributes | |
QSharedDataPointer< Data > | m_d |
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
For example:
Definition at line 100 of file FileName.h.
Isis::FileName::FileName | ( | ) |
Constructs an empty FileName object.
Definition at line 31 of file FileName.cpp.
Referenced by addExtension(), createTempFile(), fileNameQDatePattern(), highestVersionDate(), highestVersionNum(), isDateVersioned(), isNumericallyVersioned(), removeExtension(), splitNameAroundVersionNum(), validateVersioningState(), and version().
Isis::FileName::FileName | ( | const char * | file | ) |
Constructs a FileName object using a char pointer as a file name.
file | char pointer representing new filename |
Definition at line 40 of file FileName.cpp.
References Isis::FileName::Data::setOriginal().
Isis::FileName::FileName | ( | const QString & | file | ) |
Constructs a FileName object using a QString as a file name.
file | Qstring representing new filename |
Definition at line 50 of file FileName.cpp.
References Isis::FileName::Data::setOriginal().
Isis::FileName::FileName | ( | const FileName & | other | ) |
Constructs a copy of a FileName object using another FileName object.
&other | FileName object to copy. |
Definition at line 60 of file FileName.cpp.
Isis::FileName::~FileName | ( | ) |
Destroys the FileName object.
Definition at line 66 of file FileName.cpp.
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.
newExtension | The new file extension to be added at the end of the file name after all exisiting extensions. |
Definition at line 225 of file FileName.cpp.
References attributes(), extension(), FileName(), name(), and originalPath().
Referenced by Isis::Cube::create(), Isis::ImageExporter::createWorldFile(), IsisAml::GetFileName(), Isis::Cube::initLabelFromFile(), Isis::TextFile::Open(), setExtension(), Isis::Cube::write(), Isis::ImageExporter::write(), Isis::JP2Exporter::write(), Isis::QtExporter::write(), and Isis::TiffExporter::write().
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"
Definition at line 121 of file FileName.cpp.
Referenced by Isis::CubeAttribute< CubeAttributeInput >::addAttributes(), addExtension(), removeExtension(), and Isis::CubeAttribute< CubeAttributeInput >::setAttributes().
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"
Definition at line 145 of file FileName.cpp.
Referenced by Isis::ProcessPolygons::AppendOutputCube(), Isis::PipelineApplication::BuildParamString(), Isis::PipelineApplication::CalculateOutputFile(), createTempFile(), Isis::EmbreeTargetShape::EmbreeTargetShape(), Isis::Pipeline::FinalOutput(), Isis::Cube::fromIsd(), Isis::Equalization::generateOutputs(), Isis::ProcessExportPds4::identificationArea(), Isis::ImportPdsTable::load(), Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()(), removeExtension(), Isis::Kernels::resolveTypeByExt(), Isis::ProcessPolygons::SetStatCubes(), Isis::ProcessGroundPolygons::SetStatCubes(), and Isis::ProcessExportPds4::WritePds4().
Creates a temporary file and returns a FileName object created using the temporary file.
templateFileName | the file name used to create the temporary file. |
Isis::IException::Io |
Definition at line 478 of file FileName.cpp.
References baseName(), extension(), FileName(), Isis::IException::Io, original(), originalPath(), and path().
QDir Isis::FileName::dir | ( | ) | const |
Returns the path of the file's parent directory as a QDir object.
for a full file specification of: "/tmp/Peaks.cub+Bsq" dir() gives: "/tmp/"
Definition at line 465 of file FileName.cpp.
References expanded().
Referenced by Isis::Project::addControl(), Isis::Control::copyToNewProjectRoot(), highestVersionDate(), highestVersionNum(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), Isis::GuiFileNameParameter::SelectFile(), Isis::BundleSolutionInfo::updateFileName(), Isis::Control::updateFileName(), Isis::Image::updateFileName(), Isis::Shape::updateFileName(), and Isis::UserInterface::UserInterface().
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.
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"
Definition at line 196 of file FileName.cpp.
Referenced by Isis::SerialNumberList::add(), Isis::ImageExporter::addChannel(), Isis::CubeDataThread::AddCube(), Isis::GuiParameter::AddHelpers(), Isis::PushFrameCameraCcdLayout::addKernel(), Isis::Pvl::append(), Isis::Application::Application(), Isis::Blob::Blob(), Isis::ControlPointEditWidget::changeGroundLocationsInNet(), Isis::ControlPointEditWidget::checkGroundFileLocation(), Isis::CnetEditorView::CnetEditorView(), Isis::CorrelationMatrix::computeCorrelationMatrix(), Isis::ControlPointList::ControlPointList(), Isis::TiffImporter::convertProjection(), Isis::Cube::copy(), Isis::Cube::create(), Isis::ProjectionFactory::Create(), Isis::Spice::createCache(), Isis::ControlPointEditWidget::createControlPoint(), Isis::ControlMeasureEditWidget::createMeasureEditor(), Isis::QnetNavTool::createNavigationDialog(), Isis::ImageImporter::createOutput(), Isis::ControlPointEdit::createPointEditor(), Isis::ImageExporter::createWorldFile(), Isis::Image::deleteFromDisk(), Isis::Shape::deleteFromDisk(), dir(), Isis::ProcessExportPds4::displaySettings(), Isis::Module::Dump(), Isis::EmbreeTargetShape::EmbreeTargetShape(), Isis::Kernels::examine(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::ProcessImportFits::extraFitsLabel(), Isis::ProcessExportPds4::fileAreaObservational(), fileExists(), Isis::SerialNumberList::fileNameIndex(), fileNameQDatePattern(), Isis::ObservationNumber::FindObservationTranslation(), Isis::SerialNumber::FindSerialTranslation(), Isis::ProcessImportFits::fitsImageLabel(), Isis::ImageImporter::fromFileName(), Isis::Cube::fromIsd(), Isis::Cube::fromLabel(), Isis::EmbreeTargetManager::fullFilePath(), Isis::ControlNetStatistics::GeneratePointStats(), Isis::Application::GetEnviromentInfo(), IsisAml::GetFileName(), Isis::MosaicTool::getIcon(), Isis::Application::GetLibraryDependencies(), Isis::Plugin::GetPlugin(), Isis::Application::GetSystemDiskSpace(), Isis::Application::GetUnameInfo(), Isis::GuiFileNameParameter::GuiFileNameParameter(), highestVersionDate(), highestVersionNum(), Isis::ProcessExportPds4::identificationArea(), Isis::Cube::initCoreFromLabel(), Isis::Cube::initLabelFromFile(), Isis::CameraFactory::initPlugin(), Isis::MocLabels::InitWago(), Isis::BundleSolutionInfo::inputControlNetFileName(), isDateVersioned(), isNumericallyVersioned(), Isis::JP2Importer::JP2Importer(), Isis::ImportPdsTable::load(), Isis::Spice::load(), Isis::BulletDskShape::loadFromDsk(), Isis::UserInterface::loadHistory(), Isis::KernelDb::loadKernelDbFiles(), Isis::iTime::LoadLeapSecondKernel(), Isis::Mariner10Camera::Mariner10Camera(), Isis::Process::MissionData(), Isis::CubePlotCurve::mousePressEvent(), Isis::ObservationNumberList::observationNumber(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::TextFile::Open(), Isis::MosaicControlNetTool::openControlNet(), Isis::CubeManager::OpenCube(), Isis::NaifDskPlateModel::openDSK(), Isis::operator<<(), operator==(), Isis::BundleSolutionInfo::outputHeader(), Isis::XmlToPvlTranslationManager::parseFile(), path(), Isis::ControlNetStatistics::PrintImageStats(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::ProcessImportPds::ProcessLabel(), Isis::ProcessImportPds::ProcessPdsCombinedSpectrumLabel(), Isis::ProcessImportPds::ProcessPdsImageLabel(), Isis::ProcessImportPds::ProcessPdsM3Label(), Isis::ProcessImportPds::ProcessPdsQubeLabel(), Isis::Project::Project(), Isis::CorrelationMatrix::pvlObject(), Isis::PvlTranslationTable::PvlTranslationTable(), Isis::QIsisApplication::QIsisApplication(), Isis::QtImporter::QtImporter(), Isis::Target::radiiGroup(), Isis::ControlNetVersioner::read(), Isis::Pvl::read(), Isis::EmbreeTargetShape::readDSK(), Isis::OriginalXmlLabel::readFromXmlFile(), Isis::ImageOverlapSet::ReadImageOverlaps(), Isis::KernelDb::readKernelDbFiles(), Isis::PvlConstraints::readKeyListFile(), Isis::EmbreeTargetShape::readPC(), Isis::ControlNetVersioner::readProtobufV0001(), Isis::ControlNetVersioner::readProtobufV0002(), Isis::ControlNetVersioner::readProtobufV0005(), Isis::FeatureNomenclatureTool::readSettings(), Isis::FileDialog::readSettings(), Isis::MatchTool::readSettings(), Isis::PaletteWindow::readSettings(), Isis::QnetTool::readSettings(), Isis::SpecialPixelTool::readSettings(), Isis::Cube::realDataFileLabel(), Isis::Cube::realDataFileName(), Isis::Cube::reformatOldIsisLabel(), Isis::Cube::reopen(), Isis::Kernels::resolveType(), Isis::ProjectionFactory::RingsCreate(), Isis::ProgramLauncher::RunIsisProgram(), Isis::BundleSolutionInfo::save(), Isis::UserInterface::SaveHistory(), Isis::ScatterPlotWindow::ScatterPlotWindow(), Isis::GuiCubeParameter::SelectAttribute(), Isis::GuiFileNameParameter::SelectFile(), Isis::SerialNumberList::serialNumber(), Isis::MatchTool::serialNumberList(), Isis::CorrelationMatrix::setCovarianceFileName(), Isis::ProcessImportFits::setFitsFile(), Isis::ControlPointEditWidget::setGroundSourceInfo(), Isis::Pipeline::SetInputListFile(), Isis::MdiCubeViewport::setLinked(), Isis::Pipeline::SetOutputFile(), Isis::ControlNetFilter::SetOutputFile(), Isis::Pipeline::SetOutputListFile(), Isis::AdvancedTrackTool::settingsFilePath(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), Isis::MosaicMainWindow::setupMenus(), Isis::SpectralDefinition2D::SpectralDefinition2D(), splitNameAroundVersionNum(), Isis::ProcessExportPds::StandardImageImage(), Isis::ProcessExportPds4::standardInstrument(), Isis::ProcessExportPds::StandardJP2Image(), Isis::ProcessMosaic::StartProcess(), Isis::TiffImporter::TiffImporter(), Isis::Tool::Tool(), toString(), Isis::ProcessExportPds4::translateBandBinImage(), Isis::ProcessExportPds4::translateBandBinSpectrumBinSet(), Isis::ProcessExportPds4::translateBandBinSpectrumUniform(), Isis::ProcessImportPds::TranslateIsis2BandBin(), Isis::ProcessImportPds::TranslateIsis2Instrument(), Isis::ProcessImportPds::TranslatePdsArchive(), Isis::ProcessImportPds::TranslatePdsBandBin(), Isis::ProcessImportPds::TranslatePdsProjection(), Isis::MeasureTool::updateDist(), Isis::BundleSolutionInfo::updateFileName(), Isis::Control::updateFileName(), Isis::Image::updateFileName(), Isis::Shape::updateFileName(), Isis::Gui::UpdateHistory(), Isis::AdvancedTrackTool::updateRow(), Isis::BlinkTool::updateTool(), validateVersioningState(), IsisAml::Verify(), version(), Isis::VikingCamera::VikingCamera(), Isis::VoyagerCamera::VoyagerCamera(), Isis::WarningWidget::WarningWidget(), Isis::Cube::write(), Isis::Pvl::write(), Isis::ControlNetVersioner::write(), Isis::JP2Exporter::write(), Isis::QtExporter::write(), Isis::TiffExporter::write(), Isis::ImageOverlapSet::WriteImageOverlaps(), Isis::ProcessExportPds4::WritePds4(), Isis::FeatureNomenclatureTool::writeSettings(), Isis::FileDialog::writeSettings(), Isis::PaletteWindow::writeSettings(), Isis::SpecialPixelTool::writeSettings(), Isis::MatchTool::writeSettings(), Isis::QnetTool::writeSettings(), and Isis::Spice::~Spice().
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"
Definition at line 178 of file FileName.cpp.
Referenced by addExtension(), Isis::ProcessPolygons::AppendOutputCube(), Isis::ShapeModelFactory::create(), createTempFile(), Isis::EmbreeTargetShape::EmbreeTargetShape(), Isis::Equalization::generateOutputs(), Isis::BulletTargetShape::load(), Isis::Kernels::resolveTypeByExt(), setExtension(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), and Isis::ProcessExportPds4::WritePds4().
bool Isis::FileName::fileExists | ( | ) | const |
Returns true if the file exists; false otherwise.
If the file is a symlink that points to a nonexistent file, false is returned.
Definition at line 449 of file FileName.cpp.
References expanded().
Referenced by Isis::DatabaseFactory::addAccessProfile(), Isis::Application::Application(), Isis::ControlPointEditWidget::checkGroundFileLocation(), Isis::TiffImporter::convertProjection(), Isis::ProjectionFactory::Create(), Isis::InterestOperatorFactory::Create(), Isis::AutoRegFactory::Create(), Isis::PhotoModelFactory::Create(), Isis::PolygonSeederFactory::Create(), Isis::AtmosModelFactory::Create(), Isis::NormModelFactory::Create(), Isis::Kernels::examine(), Isis::Cube::initLabelFromFile(), Isis::CameraFactory::initPlugin(), Isis::OpenProjectWorkOrder::isExecutable(), Isis::ImportPdsTable::load(), Isis::Spice::load(), Isis::BulletDskShape::loadFromDsk(), Isis::UserInterface::loadHistory(), Isis::ControlPointEditWidget::loadPoint(), Isis::KernelDb::loadSystemDb(), Isis::Process::MissionData(), newVersion(), Isis::TextFile::Open(), Isis::NaifDskPlateModel::openDSK(), Isis::operator<<(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::ProcessImportPds::ProcessLabel(), Isis::EmbreeTargetShape::readDSK(), Isis::ProjectionFactory::RingsCreate(), Isis::ProgramLauncher::RunIsisProgram(), Isis::UserInterface::SaveHistory(), Isis::ControlPointEditWidget::setGroundSourceInfo(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::Gui::UpdateHistory(), Isis::Directory::updateRecentProjects(), Isis::UserInterface::UserInterface(), and IsisAml::Verify().
|
private |
This changes the files format.
Specifically quotes everything not in {} with single quotes and removes the {} from the file name.
Definition at line 727 of file FileName.cpp.
References expanded(), and FileName().
Referenced by highestVersionDate(), and version().
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.
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::PushFrameCameraCcdLayout::addKernel(), Isis::KernelDb::files(), Isis::MocLabels::InitWago(), Isis::KernelDb::loadKernelDbFiles(), Isis::iTime::LoadLeapSecondKernel(), Isis::Process::MissionData(), and Isis::Target::radiiGroup().
|
private |
This looks through the directory of the file and checks for the highest version date of the file that is versioned date.
Definition at line 578 of file FileName.cpp.
References dir(), expanded(), FileName(), fileNameQDatePattern(), name(), path(), and Isis::IException::Unknown.
Referenced by highestVersion().
|
private |
This looks through the directory of the file and checks for the highest version number of the file that is versioned numerically.
Definition at line 640 of file FileName.cpp.
References dir(), expanded(), FileName(), name(), path(), splitNameAroundVersionNum(), and Isis::IException::Unknown.
Referenced by highestVersion(), and newVersion().
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.
Definition at line 303 of file FileName.cpp.
References expanded(), and FileName().
Referenced by highestVersion(), isVersioned(), newVersion(), and validateVersioningState().
bool Isis::FileName::isNumericallyVersioned | ( | ) | const |
Checks if the file name is versioned numerically.
Returns true if the file is versioned numerically; returns false otherwise.
Definition at line 293 of file FileName.cpp.
References expanded(), and FileName().
Referenced by highestVersion(), isVersioned(), newVersion(), and splitNameAroundVersionNum().
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.
Definition at line 281 of file FileName.cpp.
References isDateVersioned(), isNumericallyVersioned(), and validateVersioningState().
Referenced by Isis::PushFrameCameraCcdLayout::addKernel(), Isis::KernelDb::files(), highestVersion(), and newVersion().
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"
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::ControlNetDiff::compare(), Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::Control::copyToNewProjectRoot(), Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::Cube::create(), Isis::QnetPointCubeNameFilter::createCubeList(), Isis::MatchTool::createPoint(), Isis::ControlPointEditWidget::createPointEditor(), Isis::UserInterface::evaluateOption(), Isis::Kernels::examine(), Isis::ImportMapTemplateWorkOrder::execute(), Isis::ImportRegistrationTemplateWorkOrder::execute(), Isis::FeatureNomenclatureTool::featuresForViewportFound(), Isis::TrackingTable::fileNameToPixel(), Isis::KernelDb::files(), Isis::QnetNavTool::filterList(), Isis::ProcessExportPds::FixedImageRoot(), Isis::ProcessExportPds::FixedJP2ImageRoot(), Isis::ControlMeasure::GetChooserName(), Isis::CorrelationMatrix::hasCovMat(), highestVersion(), highestVersionDate(), highestVersionNum(), Isis::ControlPointEditWidget::initDem(), Isis::CorrelationMatrix::isValid(), Isis::JigsawRunWidget::JigsawRunWidget(), Isis::ImportPdsTable::load(), Isis::UserInterface::loadCommandLine(), Isis::ControlPointEditWidget::loadGroundMeasure(), Isis::QnetTool::loadGroundMeasure(), Isis::MatchTool::loadPoint(), Isis::QnetTool::loadPoint(), Isis::ControlPointEditWidget::loadPoint(), newVersion(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::Cube::open(), Isis::QnetTool::openGround(), Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportControlNetWorkOrder::CreateControlsFunctor::operator()(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::ControlNetVersioner::read(), Isis::ControlNetVersioner::readProtobufV0001(), Isis::ControlNetVersioner::readProtobufV0002(), Isis::ControlNetVersioner::readProtobufV0005(), Isis::Cube::realDataFileName(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::Cube::reformatOldIsisLabel(), Isis::QnetNavTool::resetList(), Isis::ProgramLauncher::RunIsisProgram(), Isis::Project::save(), Isis::BundleSolutionInfo::save(), Isis::TemplateList::save(), Isis::JigsawSetupDialog::selectControl(), Isis::GuiFileNameParameter::SelectFile(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), Isis::Pipeline::SetInputListFile(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ProcessMapMosaic::StartProcess(), Isis::ProcessExportPds::StreamImageRoot(), Isis::ProcessExportPds::StreamJP2ImageRoot(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::MeasureTool::updateDist(), Isis::BundleSolutionInfo::updateFileName(), Isis::Control::updateFileName(), Isis::Image::updateFileName(), Isis::Shape::updateFileName(), Isis::Template::updateFileName(), Isis::AdvancedTrackTool::updateRow(), Isis::ControlPointEditWidget::validateMeasureChange(), Isis::Cube::write(), Isis::Cube::writeLabels(), and Isis::ProcessExportPds4::WritePds4().
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.
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().
bool Isis::FileName::operator!= | ( | const FileName & | rhs | ) |
Compares equality of two FileName objects.
Returns false if the two objects are equal and true otherwise.
Definition at line 568 of file FileName.cpp.
Clears the current contents of the FileName object and reinitializes it with the argument.
rhs | FileName to replace the current contents of the object. |
Definition at line 527 of file FileName.cpp.
bool Isis::FileName::operator== | ( | const FileName & | rhs | ) |
Compares equality of two FileName objects.
Returns true if the two objects are equal and false otherwise.
Definition at line 540 of file FileName.cpp.
References expanded().
QString Isis::FileName::original | ( | ) | const |
Returns the full file name including the file 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"
Definition at line 212 of file FileName.cpp.
Referenced by Isis::Cube::copy(), createTempFile(), Isis::Cube::initCoreFromLabel(), Isis::Cube::initLabelFromFile(), Isis::Cube::open(), Isis::Cube::realDataFileName(), Isis::Cube::relocateDnData(), Isis::Project::save(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), Isis::Pipeline::SetInputFile(), Isis::FileName::Data::setOriginal(), Isis::ImportImagesWorkOrder::setupExecution(), and Isis::ImportShapesWorkOrder::setupExecution().
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"
Definition at line 84 of file FileName.cpp.
Referenced by Isis::Directory::addBundleObservationView(), addExtension(), createTempFile(), Isis::KernelDb::files(), highestVersion(), newVersion(), Isis::Cube::open(), removeExtension(), version(), and Isis::ProcessExportPds4::WritePds4().
QString Isis::FileName::path | ( | ) | const |
Returns the path of the 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" path() gives: "/home/me/img"
Definition at line 103 of file FileName.cpp.
References expanded().
Referenced by Isis::ProcessPolygons::AppendOutputCube(), Isis::PipelineApplication::CalculateOutputFile(), Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), createTempFile(), Isis::Image::deleteFromDisk(), Isis::Shape::deleteFromDisk(), Isis::ProcessExportPds::ExportTable(), Isis::Pipeline::FinalOutput(), Isis::Blob::Find(), Isis::Equalization::generateOutputs(), highestVersionDate(), highestVersionNum(), Isis::ImportPdsTable::load(), Isis::ImportPdsTable::loadLabel(), Isis::QnetFileTool::open(), Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::ProcessImportPds::ProcessDataFilePointer(), Isis::ProcessImportPds::ProcessLabel(), Isis::Cube::realDataFileName(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::BundleSolutionInfo::save(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), Isis::ProcessPolygons::SetStatCubes(), Isis::ProcessGroundPolygons::SetStatCubes(), Isis::CubeViewport::setTrackingCube(), Isis::ImportImagesWorkOrder::setupExecution(), Isis::ImportShapesWorkOrder::setupExecution(), Isis::ProcessMosaic::StartProcess(), Isis::MeasureTool::updateDist(), and Isis::AdvancedTrackTool::updateRow().
FileName Isis::FileName::removeExtension | ( | ) | const |
Removes all extensions in the file name.
Definition at line 246 of file FileName.cpp.
References attributes(), baseName(), FileName(), and originalPath().
Referenced by Isis::ImageExporter::createWorldFile(), setExtension(), Isis::ProcessMosaic::StartProcess(), and Isis::Cube::write().
FileName Isis::FileName::setExtension | ( | const QString & | newExtension | ) | const |
Sets all current file extensions to a new extension in the file name.
newExtension | The new file extension to replace any current file extensions with |
Definition at line 265 of file FileName.cpp.
References addExtension(), extension(), and removeExtension().
Referenced by Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::Cube::create(), Isis::Image::deleteFromDisk(), Isis::Shape::deleteFromDisk(), Isis::Cube::initLabelFromFile(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), and Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()().
|
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.
Definition at line 757 of file FileName.cpp.
References expanded(), FileName(), and isNumericallyVersioned().
Referenced by highestVersionNum(), and version().
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.
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"
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::Cube::Cube(), Isis::ProcessImportFits::extractFitsLabels(), Isis::ProcessImportFits::extraFitsLabel(), Isis::ProcessImportFits::fitsImageLabel(), Isis::Cube::fromIsd(), Isis::Cube::fromLabel(), Isis::Cube::initCoreFromLabel(), Isis::ControlPointEditWidget::loadPoint(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::TextFile::Open(), Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::Cube::read(), Isis::FileList::read(), Isis::Cube::realDataFileLabel(), Isis::Cube::realDataFileName(), Isis::Project::save(), Isis::BundleSolutionInfo::save(), Isis::ControlList::save(), Isis::ImageList::save(), Isis::ShapeList::save(), Isis::TemplateList::save(), Isis::ProcessImportFits::setFitsFile(), Isis::SpectralDefinition1D::SpectralDefinition1D(), Isis::SpectralDefinition2D::SpectralDefinition2D(), version(), and Isis::FileList::write().
|
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().
|
private |
Returns a FileName object of the same file name but versioned numerically by the number passed in as a parameter.
versionNumber | number to version the new FileName object |
Isis::IException::Unknown |
Definition at line 398 of file FileName.cpp.
References expanded(), FileName(), originalPath(), splitNameAroundVersionNum(), and Isis::IException::Unknown.
Referenced by highestVersion(), and newVersion().
|
private |
Returns a FileName object of the same file name but versioned by the date passed in as a parameter.
versionDate | QDate to version the new FileName object |
Definition at line 437 of file FileName.cpp.
References FileName(), fileNameQDatePattern(), originalPath(), and toString().
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 15:19:05 |