smsprotocols/smsstack/test/smspdudb.inl
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent 
       
    19 */
       
    20 
       
    21 #ifndef __SMS_PDU_DB_INL__
       
    22 #define __SMS_PDU_DB_INL__
       
    23 
       
    24 #include <testconfigfileparser.h>
       
    25 
       
    26 inline CSmsPduDatabase::TSmsPduDbId::TSmsPduDbId(const CTestConfigItem* aItem, TInt aId)
       
    27 : iItem(aItem), iId(aId)
       
    28 	{
       
    29 	}
       
    30 
       
    31 inline CSmsPduDatabase::RSmsPduDbIdArray::RSmsPduDbIdArray(const TDesC8& aType, TBool aAllowDuplicates)
       
    32 : RArray<TSmsPduDbId>(), iType(aType), iAllowDuplicates(aAllowDuplicates)
       
    33 	{
       
    34 	}
       
    35 
       
    36 inline const TDesC8& CSmsPduDatabase::RSmsPduDbIdArray::Type() const
       
    37 	{
       
    38 	return iType;
       
    39 	}
       
    40 
       
    41 inline CTestConfig& CSmsPduDatabase::ConfigFile()
       
    42 	{
       
    43 	return *iConfigFile;
       
    44 	}
       
    45 
       
    46 inline const CTestConfig& CSmsPduDatabase::ConfigFile() const
       
    47 	{
       
    48 	return *iConfigFile;
       
    49 	}
       
    50 
       
    51 inline void CSmsPduDatabase::SetSectionL(const TDesC8& aSection)
       
    52 /**
       
    53  *  Sets the section to be used for the database (from iConfigFile)
       
    54  */
       
    55 	{
       
    56 	__ASSERT_DEBUG(iConfigFile != NULL, PduDbPanic(EPduDbPanicConfigFileNotConstructed));
       
    57 	iSection = iConfigFile->Section(aSection);
       
    58 	if (iSection == NULL)
       
    59 		{
       
    60 		User::Leave(KErrNotFound);
       
    61 		}
       
    62 	}
       
    63 
       
    64 inline void CSmsPduDatabase::SetSection(const CTestConfigSection& aSection)
       
    65 /**
       
    66  *  Sets the section to be used for the database. aSection does not necessary need to belong to iConfigFile
       
    67  */
       
    68 	{
       
    69 	iSection = &aSection;
       
    70 	}
       
    71 
       
    72 inline void PduDbPanic(TSmsPduDbPanic aPanic)
       
    73 	{
       
    74 	User::Panic(KSmsPduDbPanic, aPanic);
       
    75 	}
       
    76 
       
    77 inline TBool CSmsPduDatabase::IsMessage(const TDesC8& aTag) const
       
    78 	{
       
    79 	return (aTag.CompareF(KSmsPduDbMessage) == KErrNone);
       
    80 	}
       
    81 
       
    82 
       
    83 #endif