KD Reports  1.8
KDReportsErrorDetails.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSERRORDETAILS_H
24 #define KDREPORTSERRORDETAILS_H
25 
26 #include "KDReportsGlobal.h"
27 #include <QtAlgorithms>
28 
29 namespace KDReports {
30 class ErrorDetailsPrivate;
31 class XmlElementHandler;
32 
36 class KDREPORTS_EXPORT ErrorDetails
37 {
38 public:
39  ErrorDetails();
40  explicit ErrorDetails( const QString& message );
41  ErrorDetails( const ErrorDetails& other );
42 
43 
44  ~ErrorDetails();
45  inline ErrorDetails& operator=( const ErrorDetails& other );
46 
50  QString message() const;
51 
52  void setLine( int line );
53  void setColumn( int column );
54 
58  void setDriverMessage( const QString& message );
59 
60  int line() const;
61  int column() const;
62 
66  QString driverMessage() const;
67 
68  bool hasError() const;
69 
70  inline void swap( ErrorDetails & other ); //krazy:exclude=inline
71 private:
72  friend class XmlElementHandler;
73  ErrorDetailsPrivate* d; //krazy:exclude=dpointer make this const
74 };
75 
76 void ErrorDetails::swap( ErrorDetails & other )
77 {
78  qSwap( d, other.d );
79 }
80 
81 
82 ErrorDetails& ErrorDetails::operator=( const ErrorDetails& other )
83 {
84  ErrorDetails copy( other );
85  swap( copy );
86  return *this;
87 }
88 
89 } // namespace KDReports
90 
91 QT_BEGIN_NAMESPACE
92 template <> inline void qSwap( KDReports::ErrorDetails & lhs, KDReports::ErrorDetails & rhs )
93 {
94  lhs.swap( rhs );
95 }
96 QT_END_NAMESPACE
97 
98 #endif /* KDREPORTSERRORDETAILS_H */
Definition: KDReportsXmlElementHandler.h:86
Definition: KDReportsAbstractTableElement.h:36
Definition: KDReportsErrorDetails.h:36

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-reports/