Imported Upstream version 15.0.0
[platform/upstream/libzypp.git] / zypp / FileChecker.h
index d3ddf2d..579a627 100644 (file)
@@ -14,7 +14,6 @@
 
 #include <iosfwd>
 #include <list>
-#include "zypp/base/DefaultIntegral.h"
 #include "zypp/base/Exception.h"
 #include "zypp/base/Function.h"
 #include "zypp/PathInfo.h"
@@ -46,18 +45,12 @@ namespace zypp
 
   class CheckSumCheckException : public FileCheckException
   {
-  public:
-    CheckSumCheckException(const std::string &msg)
-      : FileCheckException(msg)
-    {}
+    //TODO
   };
 
   class SignatureCheckException : public FileCheckException
   {
-  public:
-    SignatureCheckException(const std::string &msg)
-      : FileCheckException(msg)
-    {}
+    //TODO
   };
 
   /**
@@ -70,7 +63,6 @@ namespace zypp
    class ChecksumFileChecker
    {
    public:
-     typedef CheckSumCheckException ExceptionType;
      /**
       * Constructor.
       * \param checksum Checksum that validates the file
@@ -93,10 +85,6 @@ namespace zypp
    class SignatureFileChecker
    {
      public:
-       typedef SignatureCheckException ExceptionType;
-       typedef function<void ( const SignatureFileChecker & checker,  const Pathname & file )> OnSigValidated;
-
-     public:
       /**
       * Constructor.
       * \param signature Signature that validates the file
@@ -120,24 +108,6 @@ namespace zypp
        */
       void setKeyContext(const KeyContext & keycontext);
 
-      /** Return the current context */
-      const KeyContext & keyContext() const
-      { return _context; }
-
-      /** Return whether the last file passed to \ref operator() was accepted.
-       * If this is \ref false \ref operator() was not invoked or threw a
-       * \ref SignatureCheckException.
-       */
-      bool fileAccepted() const
-      { return _fileAccepted; }
-
-      /** Return whether the last file passed to \ref operator() was actually sucessfully verified.
-       * If this is \c false but \ref fileAccepted, the file was accepted due to user interaction or
-       * global settings, but the signature was not verified.
-       */
-      bool fileValidated() const
-      { return _fileValidated; }
-
       /**
        * add a public key to the list of known keys
        */
@@ -146,24 +116,16 @@ namespace zypp
       void addPublicKey( const Pathname & publickey, const KeyContext & keycontext = KeyContext());
 
       /**
-       * Calls \ref KeyRing::verifyFileSignatureWorkflow to verify the file.
-       *
-       * Keep in mind the the workflow may return \c true (file accepted) due to user interaction
-       * or global defaults even if a signature was not actually sucessfully verified. Whether a
-       * signature was actually sucessfully verified can be determined by checking \ref fileValidated
-       * which is invokes IFF a signature for this file actually validated.
-       *
-       * \param file File to validate.fileValidated
-       *
-       * \throws SignatureCheckException if validation fails
-       */
+      * \short Try to validate the file
+      * \param file File to validate.
+      *
+      * \throws SignatureCheckException if validation fails
+      */
       void operator()( const Pathname &file ) const;
 
      protected:
       Pathname _signature;
       KeyContext _context;
-      mutable DefaultIntegral<bool,false> _fileAccepted;
-      mutable DefaultIntegral<bool,false> _fileValidated;
    };
 
    /**