lowlevellibsandfws/apputils/tsrc/t_strings/StringPoolStateAccessor.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-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 // The definition of the accessor class upon the RStringPool
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __STRINGPOOLSTATEACCESSOR_H__
       
    19 #define __STRINGPOOLSTATEACCESSOR_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <f32file.h>
       
    23 #include <s32stor.h>
       
    24 #include <s32file.h>
       
    25 
       
    26 #include <ecom/test_bed/testutilities.h>
       
    27 #include <ecom/test_bed/testbeddefinitions.h>
       
    28 #include <ecom/test_bed/stateaccessor.h>
       
    29 #include <stringpool.h>
       
    30 // ______________________________________________________________________________
       
    31 //
       
    32 /**
       
    33 	@internalComponent
       
    34 	Comments : State accessor for the RStringPool object under test.
       
    35  */
       
    36 class TStringPool_StateAccessor : public MStateAccessor
       
    37 	{
       
    38 public:
       
    39 	/**
       
    40 		@fn				InvariantTest(TAny* aTestObject)
       
    41 		Intended Usage	:	
       
    42 		@since			6.0
       
    43 		@param			TAny* A pointer to the object under test.
       
    44 		@return			TInt KErrNone if the invariants were valid, error code otherwise.
       
    45 		@pre 			TStringPool_StateAccessor is fully constructed.
       
    46 		@post			The class under test is set to the state specified.
       
    47 	 */
       
    48 	inline TInt InvariantTest(TAny* aTestObject);
       
    49 
       
    50 	/**
       
    51 		@fn				Internalize(TAny* aTestObject)
       
    52 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    53 		@since			6.0
       
    54 		@param			aTestObject The object to be tested
       
    55 		@return			KErrNone if the internalize was successful.
       
    56 		@return			One of the EPOC standard error codes indicating the reason
       
    57 						for the failure	to load the object state.
       
    58 		@pre 			TStringPool_StateAccessor is fully constructed, and
       
    59 						valid test object must be passed in.
       
    60 		@post			The class under test is set to the state specified
       
    61 	 */
       
    62 	inline virtual TInt Internalize(TAny* aTestObject);
       
    63 
       
    64 	/**
       
    65 		@fn				Externalize(TAny* aTestObject)
       
    66 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
    67 		@since			6.0
       
    68 		@param			aTestObject The object to be tested
       
    69 		@return			KErrNone if the internalize was successful.
       
    70 		@return			One of the EPOC standard error codes indicating the reason
       
    71 						for the failure	to externalize the object.
       
    72 		@pre 			TStringPool_StateAccessor is fully constructed, and
       
    73 						valid test object must be passed in.
       
    74 		@post			Returns an error code dependant on the result of the test
       
    75 	 */
       
    76 	inline virtual TInt Externalize(TAny* aTestObject);
       
    77 
       
    78 	/**
       
    79 		@fn				InternalizeL(RFileReadStream& aStream, RStringPool* aStringPool)
       
    80 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    81 		Error Condition	: Leaves with an error code.
       
    82 		@since			6.0
       
    83 		@param			aStream The filestream to read from .
       
    84 		@param			aStringPool A pointer to the RStringPool object under test.
       
    85 		@return			None.
       
    86 		@pre 			TStringPool_StateAccessor is fully constructed.
       
    87 		@post			The class under test is set to the state specified.
       
    88 	 */
       
    89 		inline void InternalizeL(RFileReadStream& aStream, RStringPool* aStringPool);
       
    90 
       
    91 	/**
       
    92 		@fn				ExternalizeL(RFileWriteStream& aStream, RStringPool* aStringPool)
       
    93 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
    94 		Error Condition	: Leaves with an error code.
       
    95 		@since			6.0
       
    96 		@param			aStream The filestream to persist into.
       
    97 		@param			aStringPool A pointer to the RStringPool object under test.
       
    98 		@return			None.
       
    99 		@pre 			TStringPool_StateAccessor is fully constructed.
       
   100 		@post			No change to the class under test, its internal state.
       
   101 						is persisted.
       
   102 	*/
       
   103 	inline void ExternalizeL(RFileWriteStream& aStream, RStringPool* aStringPool);
       
   104 
       
   105 private:
       
   106 	/**
       
   107 		@fn				InternalizeL(RStringPool* aStringPool)
       
   108 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
   109 		Error Condition	: Leaves with an error code.
       
   110 		@since			6.0
       
   111 		@param			TAny* A pointer to the object under test.
       
   112 		@return			None.
       
   113 		@pre 			TStringPool_StateAccessor is fully constructed.
       
   114 		@post			The class under test is set to the state specified.
       
   115 	*/
       
   116 	inline void InternalizeL(RStringPool* aStringPool);
       
   117 
       
   118 	/**
       
   119 		@fn				ExternalizeL(RStringPool* aStringPool)
       
   120 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
   121 		Error Condition	: Leaves with an error code.
       
   122 		@since			6.0
       
   123 		@param			TAny* A pointer to the object under test.
       
   124 		@return			None.
       
   125 		@pre 			TStringPool_StateAccessor is fully constructed.
       
   126 		@post			No change to the class under test, its internal state.
       
   127 						is persisted.
       
   128 	*/
       
   129 	inline void ExternalizeL(RStringPool* aStringPool);
       
   130 	};	// TStringPool_StateAccessor
       
   131 
       
   132 #include "StringPoolStateAccessor.inl"
       
   133 
       
   134 #endif // __STRINGPOOLSTATEACCESSOR_H__
       
   135