accesssec_plat/eap_type_api/inc/EapTraceSymbian.h
changeset 26 9abfd4f00d37
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
       
     1 /*
       
     2 * Copyright (c) 2001-2005 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 the License "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:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: %
       
    20 */
       
    21 
       
    22 #if !defined( _EAP_AM_TRACE_SYMBIAN_H_ )
       
    23 #define _EAP_AM_TRACE_SYMBIAN_H_
       
    24 
       
    25 #include <e32debug.h>
       
    26 
       
    27 //------------------------------------------------------------------------
       
    28 
       
    29 IMPORT_C void eap_trace_data_symbian(
       
    30 	const char * const prefix,
       
    31 	const void * const p_data,
       
    32 	const TUint data_length);
       
    33 
       
    34 //------------------------------------------------------------------------
       
    35 
       
    36 #if defined(_DEBUG) || defined(DEBUG)
       
    37 
       
    38 	#define EAP_TRACE_DEBUG_SYMBIAN(_parameter_list_) \
       
    39 			{ \
       
    40 				RDebug::Print _parameter_list_ ; \
       
    41 			} \
       
    42 
       
    43 	#define EAP_TRACE_DATA_DEBUG_SYMBIAN(_parameter_list_) \
       
    44 			{ \
       
    45 				eap_trace_data_symbian _parameter_list_ ; \
       
    46 			} \
       
    47 
       
    48 #else // #if defined(_DEBUG) || defined(DEBUG)
       
    49 
       
    50 	#define EAP_TRACE_DEBUG_SYMBIAN(_parameter_list_) 
       
    51 
       
    52 	#define EAP_TRACE_DATA_DEBUG_SYMBIAN(_parameter_list_)
       
    53 
       
    54 #endif // #if defined(_DEBUG) || defined(DEBUG)
       
    55 
       
    56 //------------------------------------------------------------------------
       
    57 
       
    58 class eap_automatic_trace_string_symbian_c
       
    59 {
       
    60 private:
       
    61 
       
    62 	/// This is pointer to the string that will be traced on destructor.
       
    63 	const TPtrC m_string;
       
    64 
       
    65 public:
       
    66 	
       
    67 	/**
       
    68 	 * The destructor traces the string.
       
    69 	 */	
       
    70 	virtual ~eap_automatic_trace_string_symbian_c()
       
    71 	{
       
    72 		if (m_string.Length() > 0)
       
    73 		{
       
    74 			EAP_TRACE_DEBUG_SYMBIAN((_L("<<< %S <<<\n"), &m_string));
       
    75 		}
       
    76 	}
       
    77 	
       
    78 	/**
       
    79 	 * The constructor sets the values for the member variables
       
    80 	 */	
       
    81 	eap_automatic_trace_string_symbian_c(
       
    82 		const TPtrC string)
       
    83 		: m_string(string)
       
    84 	{
       
    85 	}
       
    86 };
       
    87 
       
    88 #if defined(_DEBUG) || defined(DEBUG)
       
    89 
       
    90 	#define EAP_TRACE_RETURN_STRING_SYMBIAN(string) \
       
    91 		eap_automatic_trace_string_symbian_c __eap_trace_function_returns__(string)
       
    92 
       
    93 #else // #if defined(_DEBUG) || defined(DEBUG)
       
    94 
       
    95 	#define EAP_TRACE_RETURN_STRING_SYMBIAN(string)
       
    96 
       
    97 #endif // #if defined(_DEBUG) || defined(DEBUG)
       
    98 
       
    99 //------------------------------------------------------------------------
       
   100 
       
   101 
       
   102 #endif //#if !defined( _EAP_AM_TRACE_SYMBIAN_H_ )