sl@0: /* sl@0: * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Contains miscellaneous utility functions that can be used by any code in security component sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __MISCUTIL_H__ sl@0: #define __MISCUTIL_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * This namespace contains common miscellaneous utilitarian functionality meant from use in security code sl@0: */ sl@0: sl@0: namespace MiscUtil sl@0: { sl@0: /* sl@0: * Recursively deletes all folders in the path (as long as they are empty) sl@0: * sl@0: * @param aFs Connected filesystem session sl@0: * @param aPath Fully qualified path to start the recursive delete sl@0: */ sl@0: IMPORT_C void DeletePathIfEmpty(RFs& aFs, const TDesC& aPath); sl@0: /* sl@0: * Function used to extract lines of text from a buffer. Note that this only works for non-unicode text. It skips sl@0: * over blank lines and the characters '\n' or '\r' are treated as end-of-line markers. sl@0: * sl@0: * @param aBuffer Input buffer sl@0: * @param aPos Starting index into aBuffer (should be within the bounds of zero and length of buffer). sl@0: * It is updated after processing and should be passed in unchanged to correctly identify next line sl@0: * @param aLine Set to point to the start of the line identified sl@0: * @return ETrue if a line was successfully extracted from the buffer, EFalse if end of buffer reached sl@0: */ sl@0: IMPORT_C TBool ReadNonEmptyLineL(const TDesC8& aBuffer, TInt& aPos, TPtrC8& aLine); sl@0: } sl@0: sl@0: #endif // __MISCUTIL_H__