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