browserutilities/favouritesengine/ClientServer/srvsrc/FavouritesSrvFile.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 *      Implementation of class CFavouritesSrvFile
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include "FavouritesSrvFile.h"
       
    24 #include "FavouritesSrvDb.h"
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // ---------------------------------------------------------
       
    29 // CFavouritesSrvFile::NewL
       
    30 // ---------------------------------------------------------
       
    31 //
       
    32 CFavouritesSrvFile* CFavouritesSrvFile::NewL()
       
    33     {
       
    34     CFavouritesSrvFile* file = new (ELeave) CFavouritesSrvFile();
       
    35     CleanupStack::PushL( file );
       
    36     file->ConstructL();
       
    37     CleanupStack::Pop( file );
       
    38     return file;
       
    39     }
       
    40 
       
    41 void CFavouritesSrvFile::SetName(TParse aParse)
       
    42 	{
       
    43 	iFileName = aParse;
       
    44 	}
       
    45 // ---------------------------------------------------------
       
    46 // CFavouritesSrvFile::OpenL
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 void CFavouritesSrvFile::OpenL()
       
    50     {
       
    51     User::LeaveIfError( iFile.Open
       
    52         ( iFs, iFileName.FullName(), EFileStream | EFileShareReadersOnly | EFileRead ) );
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CFavouritesSrvFile::ReplaceL
       
    57 // ---------------------------------------------------------
       
    58 //
       
    59 void CFavouritesSrvFile::ReplaceL()
       
    60     {
       
    61     User::LeaveIfError( iFile.Replace
       
    62         ( iFs, iFileName.FullName(), 
       
    63         EFileStream | EFileShareExclusive | EFileWrite ) );
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // CFavouritesSrvFile::TransferToClientL
       
    68 // ---------------------------------------------------------
       
    69 //
       
    70 void CFavouritesSrvFile::TransferToClientL( const RMessage2& aMessage )
       
    71     {
       
    72     User::LeaveIfError( iFile.TransferToClient( aMessage, 1 ) );
       
    73     iFile.Close();
       
    74     }
       
    75 // ---------------------------------------------------------
       
    76 // CFavouritesSrvFile::ConstructL
       
    77 // ---------------------------------------------------------
       
    78 //
       
    79 void CFavouritesSrvFile::ConstructL()
       
    80     {
       
    81     User::LeaveIfError( iFs.Connect() );
       
    82     }
       
    83 
       
    84 
       
    85 //  End of File