libdigidocpp  4.0.0
digidoc::DataFile Class Referenceabstract

Data file wrapper providing methods for handling signed files or files to be signed in Container. More...

#include <DataFile.h>

Inherited by digidoc::DataFilePrivate.

Public Member Functions

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
 

Protected Member Functions

 DataFile ()
 

Detailed Description

Data file wrapper providing methods for handling signed files or files to be signed in Container.

Constructor & Destructor Documentation

◆ ~DataFile()

DataFile::~DataFile ( )
virtualdefault

◆ DataFile()

DataFile::DataFile ( )
protecteddefault

Member Function Documentation

◆ 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
methodmethod uri for calculating digest.
Returns
returns calculated digest value.
Exceptions
Exceptionthrows exception if the file does not exist or digest calculation fails.

◆ fileName()

digidoc::DataFile::fileName ( ) const
pure virtual

Returns data file name

◆ fileSize()

digidoc::DataFile::fileSize ( ) const
pure virtual

Returns data file size

◆ id()

digidoc::DataFile::id ( ) const
pure virtual

Returns data file id

◆ 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
pathfull file path, where the data file should be saved to. If file exists, it is overwritten
Exceptions
Exceptionif 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
osstream where data is written

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