landmarksui/engine/src/LmkFileUtils.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002 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 "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:    LandmarksUi Content File -    Static utility class for file operations.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 // INCLUDE FILES
       
    25 #include "LmkFileUtils.h"
       
    26 #include <f32file.h>
       
    27 
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 
       
    30 // ----------------------------------------------------
       
    31 // LmkFileUtils::DeleteFileL
       
    32 // ----------------------------------------------------
       
    33 //
       
    34 EXPORT_C void LmkFileUtils::DeleteFileL( const TDesC& aFile )
       
    35     {
       
    36     RFs fs;
       
    37     CleanupClosePushL( fs );
       
    38     User::LeaveIfError( fs.Connect() );
       
    39     TInt result = fs.Delete( aFile );
       
    40     if ( result != KErrNone && result != KErrNotFound )
       
    41         {
       
    42         User::Leave( result );
       
    43         }
       
    44     CleanupStack::PopAndDestroy(); // fs
       
    45     }
       
    46 // ----------------------------------------------------
       
    47 // LmkFileUtils::IsValidPath
       
    48 // ----------------------------------------------------
       
    49 //
       
    50 EXPORT_C TBool LmkFileUtils::IsValidPathL( TPtrC aFile )
       
    51     {
       
    52     RFs fs;
       
    53     CleanupClosePushL( fs );
       
    54     User::LeaveIfError( fs.Connect() );
       
    55     TBool result = fs.IsValidName( aFile );
       
    56     CleanupStack::PopAndDestroy(); // fs
       
    57     return result;
       
    58     }
       
    59 
       
    60 //  End of File