~ubuntu-branches/ubuntu/oneiric/xca/oneiric

« back to all changes in this revision

Viewing changes to lib/exception.h

  • Committer: Bazaar Package Importer
  • Author(s): Tino Keitel
  • Date: 2009-09-14 20:55:44 UTC
  • Revision ID: james.westby@ubuntu.com-20090914205544-l4qsm2tjimhd62vo
Tags: upstream-0.7.0
ImportĀ upstreamĀ versionĀ 0.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vi: set sw=4 ts=4:
 
2
 *
 
3
 * Copyright (C) 2001 - 2007 Christian Hohnstaedt.
 
4
 *
 
5
 * All rights reserved.
 
6
 */
 
7
 
 
8
#ifndef PKI_EXCEPTION_H
 
9
#define PKI_EXCEPTION_H
 
10
 
 
11
#include <qstring.h>
 
12
#include "base.h"
 
13
 
 
14
class errorEx
 
15
{
 
16
        private:
 
17
                QString msg;
 
18
        public:
 
19
                errorEx(QString txt, QString className = "")
 
20
                {
 
21
                        msg = txt;
 
22
                        if (!className.isEmpty())
 
23
                                msg += " (" + className + ")";
 
24
                }
 
25
                errorEx(const errorEx &e)
 
26
                {
 
27
                        msg = e.msg;
 
28
                }
 
29
                void appendString(QString s)
 
30
                {
 
31
                        msg = msg + " " + s;
 
32
                }
 
33
                QString getString() const
 
34
                {
 
35
                        return msg;
 
36
                }
 
37
                const char *getCString() const
 
38
                {
 
39
                        return msg.toAscii();
 
40
                }
 
41
                bool isEmpty() const
 
42
                {
 
43
                        return msg.isEmpty();
 
44
                }
 
45
};
 
46
 
 
47
#endif