browserutilities/favouritesengine/ClientServer/utilinc/UnicodeFile.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2003 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 *      Declaration of RUnicodeFile.
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef UNICODE_FILE_H
       
    22 #define UNICODE_FILE_H
       
    23 
       
    24 // INCLUDE FILES
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * Read characters from a Unicode text file.
       
    33 */
       
    34 class RUnicodeFile
       
    35     {
       
    36     public:     // New methods
       
    37 
       
    38         /**
       
    39         * Open Unicode file for input (read). Write access not supported.
       
    40         * @param aFs File Server Session handle.
       
    41         * @param aName File name.
       
    42         * @param aFileMode File opening mode.
       
    43         * @return Error code.
       
    44         */
       
    45         TInt Open( RFs& aFs, const TDesC& aName, TUint aFileMode );
       
    46 
       
    47         /**
       
    48         * Create/replace Unicode file for output (write). Existing content of
       
    49         * file is lost.
       
    50         * Read access not supported.
       
    51         * @param aFs File Server Session handle.
       
    52         * @param aName File name.
       
    53         * @param aFileMode File opening mode.
       
    54         * @return Error code.
       
    55         */
       
    56         TInt ReplaceL( RFs& aFs, const TDesC& aName, TUint aFileMode );
       
    57 
       
    58         /**
       
    59         * Close file.
       
    60         */
       
    61         void Close();
       
    62 
       
    63         /**
       
    64         * Get a character.
       
    65         * @return Character got.
       
    66         */
       
    67         TUint GetCharL();
       
    68 
       
    69         /**
       
    70         * Write Unicode descriptor to file.
       
    71         * @param aDes Descriptor to write.
       
    72         * @return Error code.
       
    73         */
       
    74         TInt Write( const TDesC16& aDes );
       
    75 
       
    76     private:    // data
       
    77 
       
    78         RFile iFile;    ///< File handle.
       
    79     };
       
    80 
       
    81 #endif
       
    82             
       
    83 // End of File