epoc32/include/test/dataaccess.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * @file
       
    16 * This contains DataAccess.h
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __DATA_ACCESS_H__
       
    22 #define __DATA_ACCESS_H__
       
    23 
       
    24 #include <test/testexecutestepbase.h>
       
    25 
       
    26 #include <test/datawrapper.h>
       
    27 
       
    28 class MDataAccess
       
    29 /**
       
    30  * @internalComponent
       
    31  * @test
       
    32  *
       
    33  * Data access interface
       
    34  */
       
    35 	{
       
    36 public:
       
    37 	/**
       
    38 	 * Read a boolean value from the configuration file.
       
    39 	 *
       
    40 	 * @param	aSectName - Section name in the config file
       
    41 	 * @param	aKeyName - text name for the value in the config file
       
    42 	 * @param	aResult - value found in config file. ETrue is represented by the case insensitive string "true"
       
    43 	 *
       
    44 	 * @return	ETrue if the section/key name was found
       
    45 	 */
       
    46 	virtual TBool			GetBoolFromConfig(const TDesC&  aSectName, const TDesC& aKeyName, TBool& aResult) =0;
       
    47 
       
    48 	/**
       
    49 	 * Read an integer value from the configuration file.
       
    50 	 *
       
    51 	 * @param	aSectName - Section name in the config file
       
    52 	 * @param	aKeyName - text name for the value in the config file
       
    53 	 * @param	aResult - value found in config file. ETrue is represented by the case insensitive string "true"
       
    54 	 *
       
    55 	 * @return	ETrue if the section/key name was found
       
    56 	 */
       
    57 	virtual TBool			GetIntFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult) =0;
       
    58 
       
    59 	/**
       
    60 	 * Read a string value from the configuration file.
       
    61 	 *
       
    62 	 * @param	aSectName - Section name in the config file
       
    63 	 * @param	aKeyName - text name for the value in the config file
       
    64 	 * @param	aResult - value found in config file. ETrue is represented by the case insensitive string "true"
       
    65 	 *
       
    66 	 * @return	ETrue if the section/key name was found
       
    67 	 */
       
    68 	virtual TBool			GetStringFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPtrC& aResult) =0;
       
    69 
       
    70 	/**
       
    71 	 * Read a hexidecimal value from the configuration file.
       
    72 	 *
       
    73 	 * @param	aSectName - Section name in the config file
       
    74 	 * @param	aKeyName - text name for the value in the config file
       
    75 	 * @param	aResult - value found in config file. ETrue is represented by the case insensitive string "true"
       
    76 	 *
       
    77 	 * @return	ETrue if the section/key name was found
       
    78 	 */
       
    79 	virtual TBool			GetHexFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult) =0;
       
    80 
       
    81 	/**
       
    82 	 * Write an integer value to the configuration file.
       
    83 	 *
       
    84 	 * @param	aSectName - Section name in the config file
       
    85 	 * @param	aKeyName - text name for the value in the config file
       
    86 	 * @param	aValue - value to write into the config file.
       
    87 	 *
       
    88 	 * @return	ETrue if successful
       
    89 	 */
       
    90 	virtual TBool			WriteIntToConfig(const TDesC& aSectName, const TDesC& aKeyName, const TInt& aValue) =0;
       
    91 
       
    92 	/**
       
    93 	 * Write a string value to the configuration file.
       
    94 	 *
       
    95 	 * @param	aSectName - Section name in the config file
       
    96 	 * @param	aKeyName - text name for the value in the config file
       
    97 	 * @param	aValue - value to write into the config file.
       
    98 	 *
       
    99 	 * @return	ETrue if successful
       
   100 	 */
       
   101 	virtual TBool			WriteStringToConfig(const TDesC& aSectName, const TDesC& aKeyName, const TPtrC& aValue) =0;
       
   102 
       
   103 	/**
       
   104 	 * Write a boolean value to the configuration file.
       
   105 	 *
       
   106 	 * @param	aSectName - Section name in the config file
       
   107 	 * @param	aKeyName - text name for the value in the config file
       
   108 	 * @param	aValue - value to write into the config file.
       
   109 	 *
       
   110 	 * @return	ETrue if successful
       
   111 	 */
       
   112 	virtual TBool			WriteBoolToConfig(const TDesC& aSectName, const TDesC& aKeyName, const TBool& aValue) =0;
       
   113 
       
   114 	/**
       
   115 	 * Write a hexidecimal value to the configuration file.
       
   116 	 *
       
   117 	 * @param	aSectName - Section name in the config file
       
   118 	 * @param	aKeyName - text name for the value in the config file
       
   119 	 * @param	aValue - value to write into the config file.
       
   120 	 *
       
   121 	 * @return	ETrue if successful
       
   122 	 */
       
   123 	virtual TBool			WriteHexToConfig(const TDesC&  aSectName, const TDesC& aKeyName, const TInt& aValue) =0;
       
   124 
       
   125 	/**
       
   126 	 * Updates the data to the shared data name passed either in Copy Mode/Append Mode
       
   127 	 *
       
   128 	 * @param	aShareName - global shared memory name
       
   129 	 * @param	aSharedDataVal - data to write
       
   130 	 * @param	aModeCopy - copy or append data
       
   131 	 *
       
   132 	 * @leave	system wide error
       
   133 	 */
       
   134 	virtual void			WriteSharedDataL(const TDesC& aShareName, TDesC& aSharedDataVal, TModeCopy aModeCopy) =0;
       
   135 
       
   136 	/**
       
   137 	 * Read data from the shared data name passed
       
   138 	 *
       
   139 	 * @param	aShareName - global shared memory name
       
   140 	 * @param	aSharedDataVal - data read
       
   141 	 *
       
   142 	 * @leave	system wide error
       
   143 	 */
       
   144 	virtual void			ReadSharedDataL(const TDesC& aShareName, TDes& aSharedDataVal) =0;
       
   145 
       
   146 	/**
       
   147 	 * Read name of data dictionary entry from configuration file and return the data wrapper
       
   148 	 *
       
   149 	 * @param	aSectionName - section in configuration file to read name of dictionary entry
       
   150 	 *
       
   151 	 * @leave	KErrBadName - name not found in configuration file
       
   152 	 * @leave	KErrNotFound - entry not found in dictinary
       
   153 	 *
       
   154 	 * @return	Data wrapper for the object
       
   155 	 */
       
   156 	virtual CDataWrapper*	GetDataWrapperL(const TDesC& aSectionName) =0;
       
   157 
       
   158 	/**
       
   159 	 * Read name of data dictionary entry from configuration file and return the data wrapper
       
   160 	 *
       
   161 	 * @param	aSectionName - section in configuration file to read name of dictionary entry
       
   162 	 *
       
   163 	 * @leave	KErrBadName - name not found in configuration file
       
   164 	 * @leave	KErrNotFound - entry not found in dictinary
       
   165 	 *
       
   166 	 * @return	The object stored in the data wrapper
       
   167 	 */
       
   168 	virtual TAny*			GetDataObjectL(const TDesC& aSectionName) =0;
       
   169 
       
   170 	/**
       
   171 	 * Read name of data dictionary entry from configuration file set the data wrappers object
       
   172 	 *
       
   173 	 * @param	aSectionName - section in configuration file to read name of dictionary entry
       
   174 	 * @param	aObject - object to set in the data wrapper
       
   175 	 *
       
   176 	 * @leave	KErrBadName - name not found in configuration file
       
   177 	 * @leave	KErrNotFound - entry not found in dictinary
       
   178 	 */
       
   179 	virtual void			SetDataObjectL(const TDesC& aSectionName, TAny* aObject) =0;
       
   180 
       
   181 	/**
       
   182 	 * Get the logger
       
   183 	 *
       
   184 	 * @see		CTestExecuteLogger
       
   185 	 *
       
   186 	 * @return	the logger
       
   187 	 */
       
   188 	virtual CTestExecuteLogger&	Logger() =0;
       
   189 	};
       
   190 
       
   191 #endif // __DATA_ACCESS_H__