phonebookui/Phonebook/PbkUI/src/RPbkResourceFile.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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: 
       
    15 *       Resource file loader for loading localized versions of resource files.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 // From Phonebook
       
    22 #include <PbkDebug.h>
       
    23 
       
    24 #include <RPbkResourceFile.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 
       
    30 EXPORT_C RPbkResourceFile::RPbkResourceFile
       
    31 		(CCoeEnv& aEnv) : 
       
    32 	iLoader(aEnv), 
       
    33 	iOpen(EFalse)
       
    34     {
       
    35     }
       
    36 
       
    37 EXPORT_C RPbkResourceFile::~RPbkResourceFile()
       
    38     {
       
    39     Close();
       
    40     }
       
    41 
       
    42 EXPORT_C void RPbkResourceFile::OpenL(const TDesC& aFileName)
       
    43     {
       
    44     if (!iOpen)
       
    45         {
       
    46         PBK_DEBUG_PRINT(PBK_DEBUG_STRING("Opening resource file"));
       
    47         TFileName fileName;
       
    48         fileName.Copy(aFileName);
       
    49         iLoader.OpenL(fileName);
       
    50         iOpen = ETrue;
       
    51         PBK_DEBUG_PRINT
       
    52             (PBK_DEBUG_STRING("Resource file opened succesfully"));
       
    53         }
       
    54     }
       
    55 
       
    56 EXPORT_C void RPbkResourceFile::Close()
       
    57     {
       
    58     if (iOpen)
       
    59         {
       
    60         iLoader.Close();
       
    61         iOpen = EFalse;
       
    62         PBK_DEBUG_PRINT(PBK_DEBUG_STRING("Resource file closed"));
       
    63         }
       
    64     }
       
    65 
       
    66 //  End of File