cryptoservices/certificateandkeymgmt/tx509/extensiontest.cpp
branchRCL_3
changeset 58 a5e05e7296f9
parent 8 35751d3474b7
child 61 641f389e9157
equal deleted inserted replaced
53:b38692a04122 58:a5e05e7296f9
     1 /*
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   133 		{			
   133 		{			
   134 		// Find next value for the specified tag and add it to the string array
   134 		// Find next value for the specified tag and add it to the string array
   135 		// if it exists.
   135 		// if it exists.
   136 		TPtrC str = Input::ParseElement(aBuf, aTag, pos, err);
   136 		TPtrC str = Input::ParseElement(aBuf, aTag, pos, err);
   137 		if (err >= 0)
   137 		if (err >= 0)
   138 			{			
   138 			{
   139 			aStrings.Append(str.AllocL());
   139 			HBufC* string = str.AllocLC();			
       
   140 			aStrings.AppendL(string);
       
   141 			CleanupStack::Pop(string);
   140 			}								
   142 			}								
   141 		}
   143 		}
   142 	while (err >= 0);	
   144 	while (err >= 0);
   143 	}
   145 	}
   144 
   146 
   145 void CExtensionTest::BuildIntList(RArray<TInt>& aInts, const TDesC& aBuf, const TDesC& aTag)
   147 void CExtensionTest::BuildIntList(RArray<TInt>& aInts, const TDesC& aBuf, const TDesC& aTag)
   146 	{	
   148 	{	
   147 	TInt pos = 0;
   149 	TInt pos = 0;
   151 		// Attempt to convert the contents of val to an int and store in  
   153 		// Attempt to convert the contents of val to an int and store in  
   152 		// the aInts array if it is a valid integer.
   154 		// the aInts array if it is a valid integer.
   153 		TInt n = Input::ParseIntElement(aBuf, aTag, pos, err);
   155 		TInt n = Input::ParseIntElement(aBuf, aTag, pos, err);
   154 		if (err >= 0)
   156 		if (err >= 0)
   155 			{
   157 			{
   156 			aInts.Append(n);
   158 			// This append should not fail as the parsing went fine. 
       
   159 			// So, ignoring the leave just to satisfy non leaving method convention.
       
   160 			TRAP_IGNORE(aInts.AppendL(n));
   157 			}								
   161 			}								
   158 		}
   162 		}
   159 	while (err >= 0);
   163 	while (err >= 0);
   160 	}
   164 	}
   161 
   165