File indexing completed on 2024-04-14 03:50:41
0001 /* 0002 This file is part of the kcalcore library. 0003 0004 SPDX-FileCopyrightText: 2001 Cornelius Schumacher <schumacher@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 /** 0009 @file 0010 This file is part of the API for handling calendar data and 0011 defines the Exception class. 0012 0013 We don't use actual C++ exceptions right now. These classes are currently 0014 returned by an error function; but we can build upon them, if/when we start 0015 to use C++ exceptions. 0016 0017 @brief 0018 Exception base class. 0019 0020 @author Cornelius Schumacher \<schumacher@kde.org\> 0021 */ 0022 0023 #include "exceptions.h" 0024 #include "calformat.h" 0025 0026 using namespace KCalendarCore; 0027 0028 namespace KCalendarCore 0029 { 0030 class ExceptionPrivate 0031 { 0032 public: 0033 /** 0034 The current exception code. 0035 */ 0036 Exception::ErrorCode mCode; 0037 0038 /** Arguments to pass to i18n(). */ 0039 QStringList mArguments; 0040 }; 0041 0042 } 0043 0044 Exception::Exception(const ErrorCode code, const QStringList &arguments) 0045 : d(new ExceptionPrivate) 0046 { 0047 d->mCode = code; 0048 d->mArguments = arguments; 0049 } 0050 0051 Exception::~Exception() 0052 { 0053 } 0054 0055 Exception::ErrorCode Exception::code() const 0056 { 0057 return d->mCode; 0058 } 0059 0060 QStringList Exception::arguments() const 0061 { 0062 return d->mArguments; 0063 }