alfwidgetutils/src/alfexception.cpp
branchRCL_3
changeset 19 4ea6f81c838a
parent 17 514d98f21c43
child 20 0e9bb658ef58
equal deleted inserted replaced
17:514d98f21c43 19:4ea6f81c838a
     1 /*
       
     2 * Copyright (c) 2007 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:  The basic implementation for presentation elements.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <alf/alfexception.h>
       
    21 
       
    22 using namespace std;
       
    23 using namespace osncore;
       
    24 
       
    25 
       
    26 
       
    27 // ======== LOCAL FUNCTIONS ========
       
    28 
       
    29 // ======== MEMBER FUNCTIONS ========
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // Constructor
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 OSN_EXPORT AlfException::AlfException( const int aErrorCode ) throw()
       
    36     {
       
    37     mErrorCode = aErrorCode;
       
    38     mInfo = 0;
       
    39     mFileAndLine = 0;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // Constructor
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 OSN_EXPORT AlfException::AlfException(
       
    47     int aErrorCode, const char* aInfo ) throw()
       
    48     {
       
    49     mErrorCode = aErrorCode;
       
    50     mInfo = aInfo;
       
    51     mFileAndLine = 0;
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // Constructor
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 OSN_EXPORT AlfException::AlfException(
       
    59     int aErrorCode, const char* aInfo, const char* aFileAndLine ) throw()
       
    60     {
       
    61     mErrorCode = aErrorCode;
       
    62     mInfo = aInfo;
       
    63     mFileAndLine = aFileAndLine;
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Destructor
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 OSN_EXPORT AlfException::~AlfException() throw()
       
    71     {
       
    72     // nothing to do!
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // Returns the error information in c-string style.
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 OSN_EXPORT const char* AlfException::what() const throw()
       
    80     {
       
    81     return "";
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // Returns the error information in integer type
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 OSN_EXPORT int AlfException::errorCode() const throw()
       
    89     {
       
    90     return mErrorCode;
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // Returns the error information in integer type
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 OSN_EXPORT const char* AlfException::info() const throw()
       
    98     {
       
    99     if ( mInfo )
       
   100         {
       
   101         return mInfo;
       
   102         }
       
   103     return "";
       
   104     }
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 // Returns the file and line information
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 OSN_EXPORT const char* AlfException::fileAndLine() const throw()
       
   111     {
       
   112     if ( mFileAndLine )
       
   113         {
       
   114         return mFileAndLine;
       
   115         }
       
   116     return "";
       
   117     }
       
   118 
       
   119 // End of File