javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swtlog.cpp
changeset 21 2a9601315dfc
child 67 63b81d807542
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - initial implementation
       
    10  *******************************************************************************/
       
    11  
       
    12 #include <QString>
       
    13 #include <QByteArray>
       
    14 
       
    15 #include "swtlog.h"
       
    16 
       
    17 using namespace Java::eSWT;
       
    18 
       
    19 SwtScopeLog::SwtScopeLog( const char* aFunctionName, const SwtLogType& aEnterType, const SwtLogType& aExitType )
       
    20     : mExitLogType( aExitType )
       
    21 	{
       
    22 	mFunctionName = new QString( aFunctionName );
       
    23 	SwtDataLog::LogData( "%s", mFunctionName->toLatin1().data(), aEnterType );
       
    24 	}
       
    25 
       
    26 SwtScopeLog::SwtScopeLog()
       
    27 	{
       
    28 	// Not used
       
    29 	}
       
    30 
       
    31 SwtScopeLog::~SwtScopeLog()
       
    32 	{
       
    33 	if( mFunctionName )
       
    34 		{
       
    35 		SwtDataLog::LogData( "%s", mFunctionName->toLatin1().data(), mExitLogType );
       
    36 		delete mFunctionName;
       
    37 		mFunctionName = NULL;
       
    38 		}
       
    39 	}
       
    40