javacommons/utils/inc/exceptionbase.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef EXCEPTIONBASE_H
       
    20 #define EXCEPTIONBASE_H
       
    21 
       
    22 #include <string>
       
    23 #include <exception>
       
    24 
       
    25 #include "javaosheaders.h"
       
    26 
       
    27 namespace java
       
    28 {
       
    29 
       
    30 namespace util
       
    31 {
       
    32 
       
    33 class OS_IMPORT ExceptionBase: public std::exception
       
    34 {
       
    35 public:
       
    36 
       
    37     OS_IMPORT ExceptionBase(const std::string& message, const std::string& file,
       
    38                             const std::string& method, int line) throw();
       
    39 
       
    40     OS_IMPORT ExceptionBase(int aErrCode,const std::string& message, const std::string& file,
       
    41                             const std::string& method, int line) throw();
       
    42 
       
    43     OS_IMPORT ExceptionBase(int aErrCode, int aStatusCode,
       
    44                             const std::string& message, const std::string& file,
       
    45                             const std::string& method, int line) throw();
       
    46 
       
    47     OS_IMPORT ExceptionBase(const std::wstring& message, const std::string& file,
       
    48                             const std::string& method, int line) throw();
       
    49 
       
    50     OS_IMPORT ExceptionBase(int aErrCode,const std::wstring& message, const std::string& file,
       
    51                             const std::string& method, int line) throw();
       
    52 
       
    53     OS_IMPORT ExceptionBase(int aErrCode, int aStatusCode,
       
    54                             const std::wstring& message, const std::string& file,
       
    55                             const std::string& method, int line) throw();
       
    56 
       
    57     OS_IMPORT virtual ~ExceptionBase() throw();
       
    58     OS_IMPORT virtual std::string toString() const;
       
    59 
       
    60     OS_IMPORT ExceptionBase(const ExceptionBase& x);
       
    61 
       
    62     OS_IMPORT virtual const char* what() const throw();
       
    63 
       
    64 public:
       
    65     int         mErrCode;
       
    66     int         mStatusCode;
       
    67     std::string mMessage;
       
    68     std::string mFile;
       
    69     std::string mMethod;
       
    70     int         mLine;
       
    71 
       
    72 private:
       
    73     ExceptionBase& operator= (const ExceptionBase&);
       
    74 
       
    75 };
       
    76 
       
    77 } //end namespace runtime
       
    78 } //end namespace java
       
    79 
       
    80 #endif // EXCEPTIONBASE_H