1/*
2 notation.h - wraps a gpgme verify result
3 Copyright (C) 2004, 2007 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_NOTATION_H__
24#define __GPGMEPP_NOTATION_H__
25
26#include <gpgme++/gpgmefw.h>
27#include <gpgme++/verificationresult.h>
28#include <gpgme++/gpgme++_export.h>
29
30#include <boost/shared_ptr.hpp>
31
32#include <iosfwd>
33
34namespace GpgME {
35
36 class GPGMEPP_EXPORT Notation {
37 friend class ::GpgME::Signature;
38 Notation( const boost::shared_ptr<VerificationResult::Private> & parent, unsigned int sindex, unsigned int nindex );
39 public:
40 Notation();
41 explicit Notation( gpgme_sig_notation_t nota );
42
43 const Notation & operator=( Notation other ) {
44 swap( other );
45 return *this;
46 }
47
48 void swap( Notation & other ) {
49 using std::swap;
50 swap( this->d, other.d );
51 }
52
53 bool isNull() const;
54
55 const char * name() const;
56 const char * value() const;
57
58 enum Flags {
59 NoFlags = 0,
60 HumanReadable = 1,
61 Critical = 2
62 };
63 Flags flags() const;
64
65 bool isHumanReadable() const;
66 bool isCritical() const;
67
68 private:
69 class Private;
70 boost::shared_ptr<Private> d;
71 };
72
73 GPGMEPP_EXPORT std::ostream & operator<<( std::ostream & os, const Notation & nota );
74 GPGMEPP_EXPORT std::ostream & operator<<( std::ostream & os, Notation::Flags flags );
75
76}
77
78GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( Notation )
79
80#endif // __GPGMEPP_NOTATION_H__
81