cryptomgmtlibs/securityutils/source/sectcbutil/miscutil.cpp
changeset 8 35751d3474b7
parent 0 2c201484c85f
child 29 ece3df019add
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
    13 *
    13 *
    14 * Description: 
    14 * Description: 
    15 * Contains miscellaneous utility functions that can be used by any code in security component
    15 * Contains miscellaneous utility functions that can be used by any code in security component
    16 *
    16 *
    17 */
    17 */
    18 
       
    19 
       
    20 
    18 
    21 
    19 
    22 /**
    20 /**
    23  @file
    21  @file
    24 */
    22 */
    79 
    77 
    80 	aPos = endPos;
    78 	aPos = endPos;
    81 	return lineIdentified;
    79 	return lineIdentified;
    82 	}
    80 	}
    83 
    81 
       
    82 /*
       
    83  * Recursively deletes all folders in the path (as long as they are empty)
       
    84  *
       
    85  * @param aFs		Connected  filesystem session
       
    86  * @param aPath		Fully qualified path to start the recursive delete
       
    87  */
       
    88 EXPORT_C void DeletePathIfEmpty(RFs& aFs, const TDesC& aPath)
       
    89 	{
       
    90 	HBufC* pathBuf = aPath.AllocLC();
       
    91 	TPtr pathPtr(pathBuf->Des());
       
    92 	TParsePtr path(pathPtr);
       
    93 
       
    94 	if (path.PathPresent())
       
    95 		{
       
    96 		while ((aFs.RmDir(path.DriveAndPath()) == KErrNone) && (path.PopDir() == KErrNone))
       
    97 			;
       
    98 		}
       
    99 	CleanupStack::PopAndDestroy(pathBuf);
       
   100 	}
       
   101 
    84 }	// namespace MiscUtil
   102 }	// namespace MiscUtil