LCOV - code coverage report
Current view: top level - lang/cpp/src - keylistresult.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 8 100.0 %
Date: 2018-11-15 08:49:49 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /*
       2             :   keylistresult.h - wraps a gpgme keylist result
       3             :   Copyright (C) 2004 Klarälvdalens Datakonsult AB
       4             :   2016 Bundesamt für Sicherheit in der Informationstechnik
       5             :   Software engineering by Intevation GmbH
       6             : 
       7             :   This file is part of GPGME++.
       8             : 
       9             :   GPGME++ is free software; you can redistribute it and/or
      10             :   modify it under the terms of the GNU Library General Public
      11             :   License as published by the Free Software Foundation; either
      12             :   version 2 of the License, or (at your option) any later version.
      13             : 
      14             :   GPGME++ is distributed in the hope that it will be useful,
      15             :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17             :   GNU Library General Public License for more details.
      18             : 
      19             :   You should have received a copy of the GNU Library General Public License
      20             :   along with GPGME++; see the file COPYING.LIB.  If not, write to the
      21             :   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
      22             :   Boston, MA 02110-1301, USA.
      23             : */
      24             : 
      25             : #ifndef __GPGMEPP_KEYLISTRESULT_H__
      26             : #define __GPGMEPP_KEYLISTRESULT_H__
      27             : 
      28             : #include "gpgmefw.h"
      29             : #include "result.h"
      30             : #include "gpgmepp_export.h"
      31             : 
      32             : #include <memory>
      33             : 
      34             : namespace GpgME
      35             : {
      36             : 
      37             : class Error;
      38             : 
      39         191 : class GPGMEPP_EXPORT KeyListResult : public Result
      40             : {
      41             : public:
      42             :     KeyListResult();
      43             :     KeyListResult(gpgme_ctx_t ctx, int error);
      44             :     KeyListResult(gpgme_ctx_t ctx, const Error &error);
      45             :     explicit KeyListResult(const Error &err);
      46             :     KeyListResult(const Error &err, const _gpgme_op_keylist_result &res);
      47             : 
      48          24 :     const KeyListResult &operator=(KeyListResult other)
      49             :     {
      50          24 :         swap(other);
      51          24 :         return *this;
      52             :     }
      53          24 :     void swap(KeyListResult &other)
      54             :     {
      55          24 :         Result::swap(other);
      56             :         using std::swap;
      57          24 :         swap(this->d, other.d);
      58          24 :     }
      59             : 
      60             :     const KeyListResult &operator+=(const KeyListResult &other)
      61             :     {
      62             :         mergeWith(other);
      63             :         return *this;
      64             :     }
      65             : 
      66             :     void mergeWith(const KeyListResult &other);
      67             : 
      68             :     bool isNull() const;
      69             : 
      70             :     bool isTruncated() const;
      71             : 
      72             : private:
      73             :     void detach();
      74             :     void init(gpgme_ctx_t ctx);
      75             :     class Private;
      76             :     std::shared_ptr<Private> d;
      77             : };
      78             : 
      79             : }
      80             : 
      81             : GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(KeyListResult)
      82             : 
      83             : #endif // __GPGMEPP_KEYLISTRESULT_H__

Generated by: LCOV version 1.13