|
WSF
|
A collection of utility functions. More...
Enumerations | |
| enum | SpectralPrintFormat { cSPF_WAVENUMBER , cSPF_WAVELENGTH } |
Functions | |
| void | SetSpectralPrintFormat (SpectralPrintFormat aSpectralPrintFormat) |
| void | PrintSpectralVector (ut::log::MessageStream &aStream, const SOSM_Selector &aSelector, const std::vector< float > &aVector, const std::string &aHeader) |
| Print a vector that represents the spectral product of something (target model, atmosphere, etc.). | |
| std::string | BaseName (const std::string &aPath) |
| A C++ equivalent of the Unix 'basename' command, without the option to remove the suffix. | |
| std::string | DirName (const std::string &aPath) |
| void | StripPathPrefix (const std::string &aPrefixedPath, std::string &aPrefix, std::string &aPath) |
| Strip off Windows/DOS path prefix data. | |
| bool | MakePath (const std::string &aPath) |
| Like Unix 'mkdir -p'. | |
| bool | CreateDirectory (const std::string &aDirName) |
| bool | DirectoryExists (const std::string &aDirName) |
| bool | FileExists (const std::string &aFileName) |
| bool | FileIsCurrent (const std::string &aTargetFile, const std::string &aSourceFile) |
| double | FileModificationTime (const std::string &aFile) |
A collection of utility functions.
| std::string SOSM_Utility::BaseName | ( | const std::string & | aPath | ) |
A C++ equivalent of the Unix 'basename' command, without the option to remove the suffix.
References StripPathPrefix().
Referenced by SOSM_Manager::CacheFileName(), and SOSM_Manager::GetCachePrefix().
| bool SOSM_Utility::CreateDirectory | ( | const std::string & | aDirName | ) |
Referenced by MakePath().
| bool SOSM_Utility::DirectoryExists | ( | const std::string & | aDirName | ) |
| std::string SOSM_Utility::DirName | ( | const std::string & | aPath | ) |
A C++ equivalent of the Unix 'dirname'. The returned value will NOT have a trailing '/'
References StripPathPrefix().
Referenced by MakePath().
| bool SOSM_Utility::FileExists | ( | const std::string & | aFileName | ) |
| bool SOSM_Utility::FileIsCurrent | ( | const std::string & | aTargetFile, |
| const std::string & | aSourceFile ) |
Is the target file current with respect to the source file?
This is similar to the check performed by the 'make' utility. A target file is considered current with respect to the source if the target and source files exist and the modification date of the target is newer than that of the source.
| aTargetFile | The file to be tested to see if it is 'current'. |
| aSourceFile | The reference (source) file to be used the comparison. |
Referenced by SOSM_ScalarTable2D::Load(), SOSM_SpectralTable2D::Load(), and SOSM_SpectralTable3D::Load().
| double SOSM_Utility::FileModificationTime | ( | const std::string & | aFile | ) |
Return the timestamp when the indicated file was last modified.
Referenced by SOSM_SensorTarget::CreateOrLoadSensorAtmosphereTables(), SOSM_SensorTarget::CreateOrLoadSensorTargetTables(), SOSM_Manager::LoadAtmosphereType(), SOSM_ScalarTable2D::LoadBinaryFile(), SOSM_ScalarTable3D::LoadBinaryFile(), SOSM_SpectralTable2D::LoadBinaryFile(), SOSM_SpectralTable3D::LoadBinaryFile(), SOSM_Manager::LoadSensorType(), SOSM_Manager::LoadTargetType(), SOSM_ScalarTable2D::LoadTextFile(), SOSM_SpectralTable2D::LoadTextFile(), and SOSM_SpectralTable3D::LoadTextFile().
| bool SOSM_Utility::MakePath | ( | const std::string & | aPath | ) |
Like Unix 'mkdir -p'.
References CreateDirectory(), DirName(), and ok.
Referenced by SOSM_Manager::CacheFileName().
| void SOSM_Utility::PrintSpectralVector | ( | ut::log::MessageStream & | aStream, |
| const SOSM_Selector & | aSelector, | ||
| const std::vector< float > & | aVector, | ||
| const std::string & | aHeader ) |
Print a vector that represents the spectral product of something (target model, atmosphere, etc.).
References SOSM_Selector::Count(), cSPF_WAVELENGTH, cSPF_WAVENUMBER, SOSM_Selector::Increment(), SOSM_Selector::Origin(), and SOSM_Selector::OutputStartIndex().
Referenced by SOSM_Sensor::ComputeTargetIrradiance().
| void SOSM_Utility::SetSpectralPrintFormat | ( | SpectralPrintFormat | aSpectralPrintFormat | ) |
Referenced by SOSM_Manager::ProcessInput().
| void SOSM_Utility::StripPathPrefix | ( | const std::string & | aPrefixedPath, |
| std::string & | aPrefix, | ||
| std::string & | aPath ) |
Strip off Windows/DOS path prefix data.
Referenced by BaseName(), and DirName().