OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimDirectory.h>
Public Types | |
enum | { OSSIM_DIR_FILES = 0x0001, OSSIM_DIR_DIRS = 0x0002, OSSIM_DIR_HIDDEN = 0x0004, OSSIM_DIR_DOTDOT = 0x0008, OSSIM_DIR_DEFAULT = OSSIM_DIR_FILES | OSSIM_DIR_DIRS | OSSIM_DIR_HIDDEN } |
Public Member Functions | |
ossimDirectory () | |
ossimDirectory (const ossimFilename &dir) | |
~ossimDirectory () | |
bool | open (const ossimFilename &dir) |
bool | isOpened () const |
bool | getFirst (ossimFilename &filename, int flags=OSSIM_DIR_DEFAULT) |
bool | getNext (ossimFilename &filename) const |
void | findAllFilesThatMatch (std::vector< ossimFilename > &result, const ossimString ®ularExpressionPattern, int flags=OSSIM_DIR_DEFAULT) |
bool | findCaseInsensitiveEquivalents (const ossimFilename &filename, std::vector< ossimFilename > &result, bool bExcludeExactMatch=true) |
Private Attributes | |
ossimDirectoryData * | theData |
Definition at line 23 of file ossimDirectory.h.
anonymous enum |
These flags define what kind of filenames is included in the list of files enumerated by GetFirst/GetNext.
Enumerator | |
---|---|
OSSIM_DIR_FILES | |
OSSIM_DIR_DIRS | |
OSSIM_DIR_HIDDEN | |
OSSIM_DIR_DOTDOT | |
OSSIM_DIR_DEFAULT |
Definition at line 31 of file ossimDirectory.h.
ossimDirectory::ossimDirectory | ( | ) |
Definition at line 188 of file ossimDirectory.cpp.
ossimDirectory::ossimDirectory | ( | const ossimFilename & | dir | ) |
ossimDirectory::~ossimDirectory | ( | ) |
void ossimDirectory::findAllFilesThatMatch | ( | std::vector< ossimFilename > & | result, |
const ossimString & | regularExpressionPattern, | ||
int | flags = OSSIM_DIR_DEFAULT |
||
) |
Definition at line 257 of file ossimDirectory.cpp.
References ossimString::c_str(), ossimRegExp::compile(), ossimFilename::file(), ossimRegExp::find(), getFirst(), getNext(), and ossimString::push_back().
Referenced by ossimLandsatTopoCorrectionFilter::findLandsatHeader(), ossimplugins::ossimTerraSarModel::findTSXLeader(), ossim::JsonConfig::JsonConfig(), and ossimFilename::wildcardRemove().
bool ossimDirectory::findCaseInsensitiveEquivalents | ( | const ossimFilename & | filename, |
std::vector< ossimFilename > & | result, | ||
bool | bExcludeExactMatch = true |
||
) |
Case insensitive search for files with the same name but with letters that have different case than the input name.
On Windows there can only be one match, but the case can be different than the input name. On UNIX there can be multiple matches.
If the bExcludeExactMatch input parameter is set to false, the original input name will be included in the 'result' vector if it is found in the directory. Otherwise (the default), the input name is excluded from the 'result' vector even if it is found in the directory.
Returns true if a name has been added to the result vector.
Definition at line 279 of file ossimDirectory.cpp.
References ossimString::c_str(), getFirst(), getNext(), ossimString::length(), and true.
bool ossimDirectory::getFirst | ( | ossimFilename & | filename, |
int | flags = OSSIM_DIR_DEFAULT |
||
) |
Definition at line 225 of file ossimDirectory.cpp.
References getNext(), isOpened(), ossimDirectoryData::rewind(), ossimDirectoryData::setFlags(), and theData.
Referenced by findAllFilesThatMatch(), findCaseInsensitiveEquivalents(), ossimDirectoryTree::getFirst(), ossimDtedElevationDatabase::inititializeExtension(), ossimElevManager::loadElevationPath(), ossimInit::loadPlugins(), ossimGeneralRasterElevationDatabase::openGeneralRasterDirectory(), and ossimGeneralRasterElevFactory::setDirectory().
bool ossimDirectory::getNext | ( | ossimFilename & | filename | ) | const |
Get next file in the enumeration started with either GetFirst() or GetFirstNormal().
Definition at line 240 of file ossimDirectory.cpp.
References isOpened(), ossimDirectoryData::read(), and theData.
Referenced by findAllFilesThatMatch(), findCaseInsensitiveEquivalents(), ossimDirectoryTree::getFirst(), getFirst(), ossimDirectoryTree::getNext(), ossimElevManager::loadElevationPath(), ossimInit::loadPlugins(), ossimGeneralRasterElevationDatabase::openGeneralRasterDirectory(), and ossimGeneralRasterElevFactory::setDirectory().
bool ossimDirectory::isOpened | ( | ) | const |
Definition at line 250 of file ossimDirectory.cpp.
References theData.
Referenced by getFirst(), getNext(), ossimDirectoryTree::isOpened(), and ossimDirectoryTree::open().
bool ossimDirectory::open | ( | const ossimFilename & | dir | ) |
Definition at line 199 of file ossimDirectory.cpp.
References ossimDirectoryData::isOk(), and theData.
Referenced by ossimLandsatTopoCorrectionFilter::findLandsatHeader(), ossimDirectoryTree::getFirst(), ossimDirectoryTree::getNext(), ossimDtedElevationDatabase::inititializeExtension(), ossim::JsonConfig::JsonConfig(), ossimElevManager::loadElevationPath(), ossimInit::loadPlugins(), ossimDirectoryTree::open(), ossimDirectory(), and ossimFilename::wildcardRemove().
|
private |
Definition at line 101 of file ossimDirectory.h.
Referenced by getFirst(), getNext(), isOpened(), open(), ossimDirectory(), and ~ossimDirectory().