WSF
SOSM_Utility Namespace Reference

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)

Detailed Description

A collection of utility functions.

Enumeration Type Documentation

◆ SpectralPrintFormat

Enumerator
cSPF_WAVENUMBER 
cSPF_WAVELENGTH 

Function Documentation

◆ BaseName()

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

◆ CreateDirectory()

bool SOSM_Utility::CreateDirectory ( const std::string & aDirName)

Referenced by MakePath().

◆ DirectoryExists()

bool SOSM_Utility::DirectoryExists ( const std::string & aDirName)

◆ DirName()

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

◆ FileExists()

bool SOSM_Utility::FileExists ( const std::string & aFileName)

◆ FileIsCurrent()

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.

Parameters
aTargetFileThe file to be tested to see if it is 'current'.
aSourceFileThe reference (source) file to be used the comparison.
Returns
true if aTargetFile and aSourceFile exist and the modification data of the target file is newer that the modification data of the source file.

Referenced by SOSM_ScalarTable2D::Load(), SOSM_SpectralTable2D::Load(), and SOSM_SpectralTable3D::Load().

◆ FileModificationTime()

◆ MakePath()

bool SOSM_Utility::MakePath ( const std::string & aPath)

Like Unix 'mkdir -p'.

References CreateDirectory(), DirName(), and ok.

Referenced by SOSM_Manager::CacheFileName().

◆ PrintSpectralVector()

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

◆ SetSpectralPrintFormat()

void SOSM_Utility::SetSpectralPrintFormat ( SpectralPrintFormat aSpectralPrintFormat)

◆ StripPathPrefix()

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

Copyrights Multiple, All Rights Reserved