source: trunk/src/dbus/qdbuserror.cpp@ 780

Last change on this file since 780 was 651, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.2 sources.

File size: 12.7 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the QtDBus module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "qdbuserror.h"
43
44#include <qdebug.h>
45#include <qvarlengtharray.h>
46
47#include "qdbus_symbols_p.h"
48#include "qdbusmessage.h"
49#include "qdbusmessage_p.h"
50
51QT_BEGIN_NAMESPACE
52
53/*
54 * Use the following Perl script to generate the error string index list:
55===== PERL SCRIPT ====
56print "static const char errorMessages_string[] =\n";
57$counter = 0;
58$i = 0;
59while (<STDIN>) {
60 chomp;
61 print " \"$_\\0\"\n";
62 $sizes[$i++] = $counter;
63 $counter += 1 + length $_;
64}
65print " \"\\0\";\n\nstatic const int errorMessages_indices[] = {\n ";
66for ($j = 0; $j < $i; ++$j) {
67 printf "$sizes[$j], ";
68}
69print "0\n};\n";
70===== PERL SCRIPT ====
71
72 * The input data is as follows:
73other
74org.freedesktop.DBus.Error.Failed
75org.freedesktop.DBus.Error.NoMemory
76org.freedesktop.DBus.Error.ServiceUnknown
77org.freedesktop.DBus.Error.NoReply
78org.freedesktop.DBus.Error.BadAddress
79org.freedesktop.DBus.Error.NotSupported
80org.freedesktop.DBus.Error.LimitsExceeded
81org.freedesktop.DBus.Error.AccessDenied
82org.freedesktop.DBus.Error.NoServer
83org.freedesktop.DBus.Error.Timeout
84org.freedesktop.DBus.Error.NoNetwork
85org.freedesktop.DBus.Error.AddressInUse
86org.freedesktop.DBus.Error.Disconnected
87org.freedesktop.DBus.Error.InvalidArgs
88org.freedesktop.DBus.Error.UnknownMethod
89org.freedesktop.DBus.Error.TimedOut
90org.freedesktop.DBus.Error.InvalidSignature
91org.freedesktop.DBus.Error.UnknownInterface
92com.trolltech.QtDBus.Error.InternalError
93org.freedesktop.DBus.Error.UnknownObject
94com.trolltech.QtDBus.Error.InvalidService
95com.trolltech.QtDBus.Error.InvalidObjectPath
96com.trolltech.QtDBus.Error.InvalidInterface
97com.trolltech.QtDBus.Error.InvalidMember
98*/
99
100// in the same order as KnownErrors!
101static const char errorMessages_string[] =
102 "other\0"
103 "org.freedesktop.DBus.Error.Failed\0"
104 "org.freedesktop.DBus.Error.NoMemory\0"
105 "org.freedesktop.DBus.Error.ServiceUnknown\0"
106 "org.freedesktop.DBus.Error.NoReply\0"
107 "org.freedesktop.DBus.Error.BadAddress\0"
108 "org.freedesktop.DBus.Error.NotSupported\0"
109 "org.freedesktop.DBus.Error.LimitsExceeded\0"
110 "org.freedesktop.DBus.Error.AccessDenied\0"
111 "org.freedesktop.DBus.Error.NoServer\0"
112 "org.freedesktop.DBus.Error.Timeout\0"
113 "org.freedesktop.DBus.Error.NoNetwork\0"
114 "org.freedesktop.DBus.Error.AddressInUse\0"
115 "org.freedesktop.DBus.Error.Disconnected\0"
116 "org.freedesktop.DBus.Error.InvalidArgs\0"
117 "org.freedesktop.DBus.Error.UnknownMethod\0"
118 "org.freedesktop.DBus.Error.TimedOut\0"
119 "org.freedesktop.DBus.Error.InvalidSignature\0"
120 "org.freedesktop.DBus.Error.UnknownInterface\0"
121 "com.trolltech.QtDBus.Error.InternalError\0"
122 "org.freedesktop.DBus.Error.UnknownObject\0"