libzypp 17.37.17
FileChecker.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_FILECHECKER_H
13#define ZYPP_FILECHECKER_H
14
15#include <iosfwd>
16#include <list>
17#include <zypp-core/base/DefaultIntegral>
18#include <zypp-media/FileCheckException>
19#include <zypp/base/Exception.h>
20#include <zypp/base/Function.h>
21#include <zypp/PathInfo.h>
22#include <zypp/CheckSum.h>
24
26namespace zypp
27{
28
29 class PublicKey;
30
38 typedef function<void ( const Pathname &file )> FileChecker;
39
43
48 {
49 public:
55 ChecksumFileChecker( CheckSum checksum );
62 void operator()( const Pathname &file ) const;
63 private:
65 };
66
71 {
72 public:
74
75 public:
82
84 SignatureFileChecker( Pathname signature_r );
85
87 void addPublicKey( const PublicKey & publickey_r );
89 void addPublicKey( const Pathname & publickey_r );
90
102 void operator()( const Pathname & file_r ) const;
103
106
107 private:
109 };
110
116 {
117 public:
118 void operator()( const Pathname &file ) const;
119 };
120
136 {
137 public:
138 void add( const FileChecker &checker );
142 void operator()( const Pathname &file ) const;
143
144 int checkersSize() const { return _checkers.size(); }
145 private:
146 std::list<FileChecker> _checkers;
147 };
148
150 std::ostream & operator<<( std::ostream & str, const FileChecker & obj );
151
153} // namespace zypp
155#endif // ZYPP_FILECHECKER_H
void operator()(const Pathname &file) const
Try to validate the file.
ChecksumFileChecker(CheckSum checksum)
Constructor.
CheckSumCheckException ExceptionType
Definition FileChecker.h:50
Checker composed of more checkers.
std::list< FileChecker > _checkers
void add(const FileChecker &checker)
void operator()(const Pathname &file) const
Checks for nothing Used as the default checker.
void operator()(const Pathname &file) const
void operator()(const Pathname &file_r) const
Call KeyRing::verifyFileSignatureWorkflow to verify the file.
keyring::VerifyFileContext & verifyContext()
void addPublicKey(const PublicKey &publickey_r)
Add a public key to the list of known keys.
keyring::VerifyFileContext _verifyContext
SignatureCheckException ExceptionType
Definition FileChecker.h:73
SignatureFileChecker()
Default Ctor for unsigned files.
I/O context for KeyRing::verifyFileSignatureWorkflow.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Definition FileChecker.h:38