NetCDF Timestamp Mapper  1.0
Maps timestamps (and variables) to netCDF files using sqlite3.
tsm::TimestampMapper Class Reference

#include <TimestampMapper.hpp>

Collaboration diagram for tsm::TimestampMapper:

Public Member Functions

 TimestampMapper (const std::filesystem::path &inputDir, const std::filesystem::path &outputDir, const std::string &datasetName, const std::string &regexPattern, const std::string &fileList, const ds::DATASET_TYPE datasetType, const bool regenIndices, const bool dryRun)
 
bool exec ()
 

Private Member Functions

auto sanitizeDatasetName (const std::string &datasetName) const
 
auto sanitizeDirectoryPath (const std::string &dirPath) const
 
auto fileOrDirExists (const std::filesystem::path &path) const
 
bool createDirectory (const std::filesystem::path &path) const noexcept
 
std::vector< std::filesystem::path > createFileList (const std::filesystem::path &inputDirOrIndexFile, const std::string &regex) const
 
void deleteIndexFile ()
 

Private Attributes

const std::filesystem::path m_inputDir
 
const std::filesystem::path m_outputDir
 
const std::string m_datasetName
 
const std::string m_regexPattern
 
const ds::DATASET_TYPE m_datasetType
 
const bool m_regenIndices { false }
 
const bool m_dryRun { false }
 
const std::filesystem::path m_filesToIndexPath
 
bool m_indexFileExists { false }
 
Database m_database
 

Constructor & Destructor Documentation

tsm::TimestampMapper::TimestampMapper ( const std::filesystem::path &  inputDir,
const std::filesystem::path &  outputDir,
const std::string &  datasetName,
const std::string &  regexPattern,
const std::string &  fileList,
const ds::DATASET_TYPE  datasetType,
const bool  regenIndices,
const bool  dryRun 
)

Member Function Documentation

bool tsm::TimestampMapper::createDirectory ( const std::filesystem::path &  path) const
privatenoexcept
std::vector< fs::path > tsm::TimestampMapper::createFileList ( const std::filesystem::path &  inputDirOrIndexFile,
const std::string &  regex 
) const
private
void tsm::TimestampMapper::deleteIndexFile ( )
private
bool tsm::TimestampMapper::exec ( )

Runs the tool. Returns true on success, false on failure.

auto tsm::TimestampMapper::fileOrDirExists ( const std::filesystem::path &  path) const
inlineprivate
auto tsm::TimestampMapper::sanitizeDatasetName ( const std::string &  datasetName) const
inlineprivate
auto tsm::TimestampMapper::sanitizeDirectoryPath ( const std::string &  dirPath) const
inlineprivate

Member Data Documentation

Database tsm::TimestampMapper::m_database
private
const std::string tsm::TimestampMapper::m_datasetName
private
const ds::DATASET_TYPE tsm::TimestampMapper::m_datasetType
private
const bool tsm::TimestampMapper::m_dryRun { false }
private
const std::filesystem::path tsm::TimestampMapper::m_filesToIndexPath
private
bool tsm::TimestampMapper::m_indexFileExists { false }
private
const std::filesystem::path tsm::TimestampMapper::m_inputDir
private
const std::filesystem::path tsm::TimestampMapper::m_outputDir
private
const bool tsm::TimestampMapper::m_regenIndices { false }
private
const std::string tsm::TimestampMapper::m_regexPattern
private

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