Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::input::ValidatedDataSource Class Reference

A data source which is validated with a checksum. More...

#include <validated_data_source.h>

Inheritance diagram for hgps::input::ValidatedDataSource:
[legend]
Collaboration diagram for hgps::input::ValidatedDataSource:
[legend]

Public Member Functions

 ValidatedDataSource (std::string source, const std::filesystem::path &root_path, std::string file_hash)
 Create a new ValidatedDataSource.
 ~ValidatedDataSource () override=default
std::string compute_file_hash (const std::filesystem::path &zip_file_path) const override
 Compute the checksum for the file.
Public Member Functions inherited from hgps::input::DataSource
 DataSource (std::string source)
 Create a new DataSource.
 DataSource (std::string source, const std::filesystem::path &root_path)
 Create a new DataSource, rebasing relative paths if needed.
virtual ~DataSource ()=default
 DataSource (const DataSource &) noexcept=default
 DataSource (DataSource &&) noexcept=default
DataSource & operator= (const DataSource &) noexcept=default
DataSource & operator= (DataSource &&) noexcept=default
std::filesystem::path get_data_directory () const
 Get the path to a directory containing the data.

Additional Inherited Members

Protected Attributes inherited from hgps::input::DataSource
std::string source_

Detailed Description

A data source which is validated with a checksum.

Constructor & Destructor Documentation

◆ ValidatedDataSource()

hgps::input::ValidatedDataSource::ValidatedDataSource ( std::string source,
const std::filesystem::path & root_path,
std::string file_hash )
explicit

Create a new ValidatedDataSource.

Parameters
sourceFile path or URL
root_pathPath to use as root for relative paths
file_hashSHA256 hash of file contents
Here is the call graph for this function:

◆ ~ValidatedDataSource()

hgps::input::ValidatedDataSource::~ValidatedDataSource ( )
overridedefault

Member Function Documentation

◆ compute_file_hash()

std::string hgps::input::ValidatedDataSource::compute_file_hash ( const std::filesystem::path & zip_file_path) const
overridevirtual

Compute the checksum for the file.

Parameters
zip_file_pathPath to zip file
Returns
The calculated checksum

Reimplemented from hgps::input::DataSource.

Here is the call graph for this function:

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