toolsandutils/e32tools/elf2e32/source/messagehandler.cpp
changeset 0 83f4b4db085c
child 10 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Error Message Interface Operations for elf2e32 tool
       
    15 // @internalComponent
       
    16 // @released
       
    17 // 
       
    18 //
       
    19 
       
    20 #include "messagehandler.h"
       
    21 #include "messageimplementation.h"
       
    22 
       
    23 Message* MessageHandler::iInstance=0;
       
    24 
       
    25 /**
       
    26 Function Get Instance of class Message Implementation and initializing messages.
       
    27 
       
    28 @internalComponent
       
    29 @released
       
    30 
       
    31 @return Instance of MessageImplementation
       
    32 */
       
    33 Message * MessageHandler::GetInstance()
       
    34 {
       
    35     if(iInstance == 0)
       
    36 	{
       
    37 		iInstance = new MessageImplementation();
       
    38 		iInstance->InitializeMessages(NULL);
       
    39 	}
       
    40 	return iInstance;
       
    41 }
       
    42 
       
    43 /**
       
    44 Function to call StartLogging function of class Message Implementation.
       
    45 
       
    46 @internalComponent
       
    47 @released
       
    48 
       
    49 @param aFileName
       
    50 Name of the Log File
       
    51 */
       
    52 void MessageHandler::StartLogging(char *aFileName)
       
    53 {
       
    54     GetInstance()->StartLogging(aFileName);
       
    55 }
       
    56 
       
    57 /**
       
    58 Function to call InitializeMessages function of class Message Implementation.
       
    59 
       
    60 @internalComponent
       
    61 @released
       
    62 
       
    63 @param aFileName
       
    64 Name of the Message file 
       
    65 */
       
    66 void MessageHandler::InitializeMessages(char *aFileName)
       
    67 {
       
    68 	GetInstance()->InitializeMessages(aFileName);
       
    69 }
       
    70 
       
    71 /**
       
    72 Function to delete instance of class MessageImplementation
       
    73 
       
    74 @internalComponent
       
    75 @released
       
    76 */
       
    77 void MessageHandler::CleanUp()
       
    78 {
       
    79 	delete iInstance;
       
    80 }