phonebookengines/VirtualPhonebook/VPbkEngUtils/src/CVPbkDiskSpaceCheck.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Check Flash File system disk space
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <sysutil.h>
       
    20 #include "CVPbkDiskSpaceCheck.h"
       
    21 
       
    22 namespace VPbkEngUtils {
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 CVPbkDiskSpaceCheck::CVPbkDiskSpaceCheck( RFs& aFs, TInt aDrive ) :
       
    27     iFs ( aFs ),
       
    28     iDrive ( aDrive )
       
    29     {
       
    30     }
       
    31 
       
    32 CVPbkDiskSpaceCheck::~CVPbkDiskSpaceCheck()
       
    33     {
       
    34     }
       
    35 
       
    36 EXPORT_C CVPbkDiskSpaceCheck* CVPbkDiskSpaceCheck::NewL( RFs& aFs, TInt aDrive )
       
    37     {
       
    38     CVPbkDiskSpaceCheck* self = new( ELeave ) CVPbkDiskSpaceCheck( aFs, aDrive );
       
    39     return self;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CVPbkFFSCheck::FFSClCheckL
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 EXPORT_C void CVPbkDiskSpaceCheck::DiskSpaceCheckL(TInt aBytesToWrite/*=0*/)
       
    47     {
       
    48     if (SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, aBytesToWrite, iDrive) )
       
    49         {
       
    50         // Show not enough memory note
       
    51         User::Leave(KErrDiskFull);
       
    52         }
       
    53     }
       
    54     
       
    55 } // namespace VPbkEngUtils
       
    56 
       
    57