os/security/cryptomgmtlibs/securityutils/inc/miscutil.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2008-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 "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: 
    15 * Contains miscellaneous utility functions that can be used by any code in security component
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @publishedPartner
    23  @released
    24 */
    25 
    26 #ifndef __MISCUTIL_H__
    27 #define __MISCUTIL_H__
    28 
    29 #include <e32base.h>
    30 #include <f32file.h>
    31 
    32 /**
    33  * This namespace contains common miscellaneous utilitarian functionality meant from use in security code
    34  */
    35 
    36 namespace MiscUtil
    37 	{
    38 	/*
    39 	 * Recursively deletes all folders in the path (as long as they are empty)
    40 	 *
    41 	 * @param aFs		Connected  filesystem session
    42 	 * @param aPath		Fully qualified path to start the recursive delete
    43 	 */
    44 	IMPORT_C void DeletePathIfEmpty(RFs& aFs, const TDesC& aPath);
    45 	/*
    46 	 * Function used to extract lines of text from a buffer. Note that this only works for non-unicode text. It skips
    47 	 * over blank lines and the characters '\n' or '\r' are treated as end-of-line markers.
    48 	 *
    49 	 * @param aBuffer		Input buffer
    50 	 * @param aPos		Starting index into aBuffer (should be within the bounds of zero and length of buffer). 
    51 	 *				It is updated after processing and should be passed in unchanged to correctly identify next line
    52 	 * @param aLine		Set to point to the start of the line identified
    53 	 * @return			ETrue if a line was successfully extracted from the buffer, EFalse if end of buffer reached
    54 	 */
    55 	IMPORT_C TBool ReadNonEmptyLineL(const TDesC8& aBuffer, TInt& aPos, TPtrC8& aLine);
    56 	}
    57 
    58 #endif // __MISCUTIL_H__