• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkleo

  • sources
  • kde-4.14
  • kdepim
  • libkleo
  • kleo
exception.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  exception.h
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  Copyright (c) 2008 Klarälvdalens Datakonsult AB
6 
7  Libkleopatra is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of the
10  License, or (at your option) any later version.
11 
12  Libkleopatra 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 GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #ifndef __KLEO_EXCEPTION_H__
34 #define __KLEO_EXCEPTION_H__
35 
36 #include "kleo/kleo_export.h"
37 
38 #include <gpg-error.h>
39 #include <gpgme++/exception.h>
40 
41 #include <QString>
42 
43 namespace Kleo {
44 
45  class KLEO_EXPORT Exception : public GpgME::Exception {
46  public:
47  Exception( gpg_error_t e, const std::string & msg, Options opt=NoOptions )
48  : GpgME::Exception( GpgME::Error( e ), msg, opt ) {}
49  Exception( gpg_error_t e, const char* msg, Options opt=NoOptions )
50  : GpgME::Exception( GpgME::Error( e ), msg, opt ) {}
51  Exception( gpg_error_t e, const QString & msg, Options opt=NoOptions )
52  : GpgME::Exception( GpgME::Error( e ), msg.toLocal8Bit().constData(), opt ) {}
53 
54  Exception( const GpgME::Error & e, const std::string & msg )
55  : GpgME::Exception( e, msg ) {}
56  Exception( const GpgME::Error & e, const char* msg )
57  : GpgME::Exception( e, msg ) {}
58  Exception( const GpgME::Error & e, const QString & msg )
59  : GpgME::Exception( e, msg.toLocal8Bit().constData() ) {}
60 
61  ~Exception() throw ();
62 
63  const std::string & messageLocal8Bit() const { return GpgME::Exception::message(); }
64  gpg_error_t error_code() const { return error().encodedError(); }
65 
66  QString message() const { return QString::fromLocal8Bit( GpgME::Exception::message().c_str() ); }
67  };
68 
69 }
70 
71 #endif /* __KLEO_EXCEPTION_H__ */
Kleo::Exception::Exception
Exception(gpg_error_t e, const char *msg, Options opt=NoOptions)
Definition: exception.h:49
Kleo::Exception::Exception
Exception(const GpgME::Error &e, const QString &msg)
Definition: exception.h:58
Kleo::Exception::Exception
Exception(gpg_error_t e, const QString &msg, Options opt=NoOptions)
Definition: exception.h:51
QString::fromLocal8Bit
QString fromLocal8Bit(const char *str, int size)
Kleo::Exception::Exception
Exception(const GpgME::Error &e, const std::string &msg)
Definition: exception.h:54
QString
KLEO_EXPORT
#define KLEO_EXPORT
Definition: kleo_export.h:41
Kleo::Exception
Definition: exception.h:45
Kleo::Exception::Exception
Exception(const GpgME::Error &e, const char *msg)
Definition: exception.h:56
Kleo::Exception::message
QString message() const
Definition: exception.h:66
Kleo::Exception::Exception
Exception(gpg_error_t e, const std::string &msg, Options opt=NoOptions)
Definition: exception.h:47
Kleo::Exception::error_code
gpg_error_t error_code() const
Definition: exception.h:64
kleo_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkleo

Skip menu "libkleo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal