Data file wrapper providing methods for handling signed files or files to be signed in Container
.
More...
#include <DataFile.h>
Inherited by digidoc::DataFilePrivate.
|
virtual | ~DataFile () |
|
virtual std::string | id () const =0 |
|
virtual std::string | fileName () const =0 |
|
virtual unsigned long | fileSize () const =0 |
|
virtual std::string | mediaType () const =0 |
|
virtual std::vector< unsigned char > | calcDigest (const std::string &method) const =0 |
|
virtual void | saveAs (std::ostream &os) const =0 |
|
virtual void | saveAs (const std::string &path) const =0 |
|
Data file wrapper providing methods for handling signed files or files to be signed in Container
.
◆ ~DataFile()
◆ DataFile()
◆ calcDigest()
digidoc::DataFile::calcDigest |
( |
const std::string & |
method | ) |
const |
|
pure virtual |
Calculates digest for data file. If digest is already calculated returns it, otherwise calculates the digest.
Supported uris:
- Parameters
-
method | method uri for calculating digest. |
- Returns
- returns calculated digest value.
- Exceptions
-
Exception | throws exception if the file does not exist or digest calculation fails. |
◆ fileName()
digidoc::DataFile::fileName |
( |
| ) |
const |
|
pure virtual |
◆ fileSize()
digidoc::DataFile::fileSize |
( |
| ) |
const |
|
pure virtual |
◆ id()
digidoc::DataFile::id |
( |
| ) |
const |
|
pure virtual |
◆ mediaType()
digidoc::DataFile::mediaType |
( |
| ) |
const |
|
pure virtual |
Returns data file's media type
◆ saveAs() [1/2]
void digidoc::DataFile::saveAs |
( |
const std::string & |
path | ) |
const |
|
pure virtual |
Saves a copy of the data file as file specified by path.
- Parameters
-
path | full file path, where the data file should be saved to. If file exists, it is overwritten |
- Exceptions
-
Exception | if part of path does not exist or path is existing directory (without file name) |
◆ saveAs() [2/2]
void digidoc::DataFile::saveAs |
( |
std::ostream & |
os | ) |
const |
|
pure virtual |
Saves a copy of the data file as file specified by stream.
- Parameters
-
os | stream where data is written |
The documentation for this class was generated from the following files: