Blame lang/cpp/src/importresult.h

Packit Service 672cf4
/*
Packit Service 672cf4
  importresult.h - wraps a gpgme import result
Packit Service 672cf4
  Copyright (C) 2004 Klarälvdalens Datakonsult AB
Packit Service 672cf4
  2016 Bundesamt für Sicherheit in der Informationstechnik
Packit Service 672cf4
  Software engineering by Intevation GmbH
Packit Service 672cf4
Packit Service 672cf4
  This file is part of GPGME++.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is free software; you can redistribute it and/or
Packit Service 672cf4
  modify it under the terms of the GNU Library General Public
Packit Service 672cf4
  License as published by the Free Software Foundation; either
Packit Service 672cf4
  version 2 of the License, or (at your option) any later version.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is distributed in the hope that it will be useful,
Packit Service 672cf4
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 672cf4
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 672cf4
  GNU Library General Public License for more details.
Packit Service 672cf4
Packit Service 672cf4
  You should have received a copy of the GNU Library General Public License
Packit Service 672cf4
  along with GPGME++; see the file COPYING.LIB.  If not, write to the
Packit Service 672cf4
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit Service 672cf4
  Boston, MA 02110-1301, USA.
Packit Service 672cf4
*/
Packit Service 672cf4
Packit Service 672cf4
#ifndef __GPGMEPP_IMPORTRESULT_H__
Packit Service 672cf4
#define __GPGMEPP_IMPORTRESULT_H__
Packit Service 672cf4
Packit Service 672cf4
#include "gpgmefw.h"
Packit Service 672cf4
#include "result.h"
Packit Service 672cf4
#include "gpgmepp_export.h"
Packit Service 672cf4
Packit Service 672cf4
#include <memory>
Packit Service 672cf4
Packit Service 672cf4
#include <vector>
Packit Service 672cf4
Packit Service 672cf4
namespace GpgME
Packit Service 672cf4
{
Packit Service 672cf4
Packit Service 672cf4
class Error;
Packit Service 672cf4
class Import;
Packit Service 672cf4
Packit Service 672cf4
class GPGMEPP_EXPORT ImportResult : public Result
Packit Service 672cf4
{
Packit Service 672cf4
public:
Packit Service 672cf4
    ImportResult();
Packit Service 672cf4
    ImportResult(gpgme_ctx_t ctx, int error);
Packit Service 672cf4
    ImportResult(gpgme_ctx_t ctx, const Error &error);
Packit Service 672cf4
    explicit ImportResult(const Error &error);
Packit Service 672cf4
Packit Service 672cf4
    const ImportResult &operator=(ImportResult other)
Packit Service 672cf4
    {
Packit Service 672cf4
        swap(other);
Packit Service 672cf4
        return *this;
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    void swap(ImportResult &other)
Packit Service 672cf4
    {
Packit Service 672cf4
        Result::swap(other);
Packit Service 672cf4
        using std::swap;
Packit Service 672cf4
        swap(this->d, other.d);
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    bool isNull() const;
Packit Service 672cf4
Packit Service 672cf4
    int numConsidered() const;
Packit Service 672cf4
    int numKeysWithoutUserID() const;
Packit Service 672cf4
    int numImported() const;
Packit Service 672cf4
    int numRSAImported() const;
Packit Service 672cf4
    int numUnchanged() const;
Packit Service 672cf4
Packit Service 672cf4
    int newUserIDs() const;
Packit Service 672cf4
    int newSubkeys() const;
Packit Service 672cf4
    int newSignatures() const;
Packit Service 672cf4
    int newRevocations() const;
Packit Service 672cf4
Packit Service 672cf4
    int numSecretKeysConsidered() const;
Packit Service 672cf4
    int numSecretKeysImported() const;
Packit Service 672cf4
    int numSecretKeysUnchanged() const;
Packit Service 672cf4
Packit Service 672cf4
    int notImported() const;
Packit Service 0ef63b
    int numV3KeysSkipped() const;
Packit Service 672cf4
Packit Service 672cf4
    Import import(unsigned int idx) const;
Packit Service 672cf4
    std::vector<Import> imports() const;
Packit Service 672cf4
Packit Service 672cf4
    class Private;
Packit Service 672cf4
private:
Packit Service 672cf4
    void init(gpgme_ctx_t ctx);
Packit Service 672cf4
    std::shared_ptr<Private> d;
Packit Service 672cf4
};
Packit Service 672cf4
Packit Service 672cf4
class GPGMEPP_EXPORT Import
Packit Service 672cf4
{
Packit Service 672cf4
    friend class ::GpgME::ImportResult;
Packit Service 672cf4
    Import(const std::shared_ptr<ImportResult::Private> &parent, unsigned int idx);
Packit Service 672cf4
public:
Packit Service 672cf4
    Import();
Packit Service 672cf4
Packit Service 672cf4
    const Import &operator=(Import other)
Packit Service 672cf4
    {
Packit Service 672cf4
        swap(other);
Packit Service 672cf4
        return *this;
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    void swap(Import &other)
Packit Service 672cf4
    {
Packit Service 672cf4
        using std::swap;
Packit Service 672cf4
        swap(this->d, other.d);
Packit Service 672cf4
        swap(this->idx, other.idx);
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    bool isNull() const;
Packit Service 672cf4
Packit Service 672cf4
    const char *fingerprint() const;
Packit Service 672cf4
    Error error() const;
Packit Service 672cf4
Packit Service 672cf4
    enum Status {
Packit Service 672cf4
        Unknown = 0x0,
Packit Service 672cf4
        NewKey = 0x1,
Packit Service 672cf4
        NewUserIDs = 0x2,
Packit Service 672cf4
        NewSignatures = 0x4,
Packit Service 672cf4
        NewSubkeys = 0x8,
Packit Service 672cf4
        ContainedSecretKey = 0x10
Packit Service 672cf4
    };
Packit Service 672cf4
    Status status() const;
Packit Service 672cf4
Packit Service 672cf4
private:
Packit Service 672cf4
    std::shared_ptr<ImportResult::Private> d;
Packit Service 672cf4
    unsigned int idx;
Packit Service 672cf4
};
Packit Service 672cf4
Packit Service 0ef63b
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const ImportResult &irs);
Packit Service 0ef63b
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Import &imp);
Packit Service 0ef63b
Packit Service 0ef63b
} // namespace GpgME
Packit Service 672cf4
Packit Service 672cf4
GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(ImportResult)
Packit Service 672cf4
GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(Import)
Packit Service 672cf4
Packit Service 672cf4
#endif // __GPGMEPP_IMPORTRESULT_H__